perm filename PART3.XGP[206,LSP] blob
sn#267583 filedate 1977-02-22 generic text, type T, neo UTF8
/FONT#0=BASL30/FONT#1=BASI30/FONT#2=BASB30/FONT#3=CLAR30/FONT#4=BAXM30/TMAR=200/BMAR=200/PMAR=1794
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓β␈↓ ∧zPart 3 - The System
␈↓ α_␈↓β␈↓ ¬~Table of Contents
␈↓ α_␈↓1.␈↓ β_The System␈↓ ∧H. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
L␈↓∧3-1␈↓
␈↓ α_␈↓1.1␈↓ β_The Top Level Function␈↓ ¬h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
L␈↓∧3-1␈↓
␈↓ α_␈↓1.2␈↓ β_Break Points␈↓ ∧H. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
L␈↓∧3-3␈↓
␈↓ α_␈↓1.3␈↓ β_Control Characters␈↓ ¬(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
L␈↓∧3-6␈↓
␈↓ α_␈↓1.4␈↓ β_Exceptional Condition Handling␈↓ εH. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-11␈↓
␈↓ α_␈↓1.4.1␈↓ β_The LISP Error System␈↓ ¬h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-11␈↓
␈↓ α_␈↓1.4.2␈↓ β_User Interrupts␈↓ ∧h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-12␈↓
␈↓ α_␈↓1.4.3␈↓ β_Table of User Interrupt Channels␈↓ εh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-15␈↓
␈↓ α_␈↓1.4.4␈↓ β_Autoload␈↓ ∧(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-18␈↓
␈↓ α_␈↓1.5␈↓ β_Debugging␈↓ ∧(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-20␈↓
␈↓ α_␈↓1.5.1␈↓ β_Binding, Pdl Pointers, and the Evaluator␈↓ πH. . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-20␈↓
␈↓ α_␈↓1.5.2␈↓ β_Functions for Debugging␈↓ ¬h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-20␈↓
␈↓ α_␈↓1.5.3␈↓ β_The Trace Package␈↓ ¬(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-25␈↓
␈↓ α_␈↓1.5.4␈↓ β_The Stepper␈↓ ∧H. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-30␈↓
␈↓ α_␈↓1.6␈↓ β_Storage Management␈↓ ¬(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-43␈↓
␈↓ α_␈↓1.6.1␈↓ β_Garbage Collection␈↓ ¬(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-43␈↓
␈↓ α_␈↓1.6.2␈↓ β_Spaces␈↓ ∧λ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-44␈↓
␈↓ α_␈↓1.6.3␈↓ β_Storage Control Functions␈↓ ¬h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-47␈↓
␈↓ α_␈↓1.6.4␈↓ β_Dynamic Space and Pdl Expansion␈↓ εh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-47␈↓
␈↓ α_␈↓1.6.5␈↓ β_Initial Allocation␈↓ ¬λ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-48␈↓
␈↓ α_␈↓1.7␈↓ β_Implementing Subsystems with MACLISP␈↓ πH. . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-51␈↓
␈↓ α_␈↓1.7.1␈↓ β_Entering LISP␈↓ ∧h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-51␈↓
␈↓ α_␈↓1.7.2␈↓ β_Saving an Environment␈↓ ¬h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-52␈↓
␈↓ α_␈↓1.7.3␈↓ β_Gaining and Keeping Control␈↓ ε(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-54␈↓
␈↓ α_␈↓1.7.4␈↓ β_Purity␈↓ ∧λ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-55␈↓
␈↓ α_␈↓1.8␈↓ β_Miscellaneous Functions␈↓ ¬h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-60␈↓
␈↓ α_␈↓1.8.1␈↓ β_The Status Functions␈↓ ¬(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-60␈↓
␈↓ α_␈↓1.8.2␈↓ β_Time␈↓ ∧λ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-71␈↓
␈↓ α_␈↓1.8.3␈↓ β_Escaping from Lisp␈↓ ¬(. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ␈↓
;␈↓∧3-72␈↓
␈↓ α_␈↓February 10, 1977␈↓ εH␈↓
∞Page 3-1
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1. The System␈↓
␈↓ α_␈↓␈↓β1.1 The Top Level Function␈↓
␈↓ α_␈↓␈↓ αHThe␈α
following␈α
function␈α
is␈αan␈α
approximation␈α
to␈α
what␈αMACLISP␈α
does␈α
when␈α
it␈αis
␈↓ α_␈↓at its "top level."
␈↓ α_␈↓α␈↓ αx(defun standard-top-level nil
␈↓ α_␈↓α␈↓ αx (prog (↑q ↑w ↑r evalhook base ibase ... )
␈↓ α_␈↓α␈↓ αx errs ;errors, uncaught throws, etc. come here
␈↓ α_␈↓α␈↓ αx ↑g ;ctrl/g quits come here
␈↓ α_␈↓α␈↓ αx (reset-bound-vars-and-restore-pdls)
␈↓ α_␈↓α␈↓ αx (setq ↑q nil ↑w nil evalhook nil)
␈↓ α_␈↓α␈↓ αx (nointerrupt nil)
␈↓ α_␈↓α␈↓ αx (do-delayed-tty-and-alarmclock-interrupts)
␈↓ α_␈↓α␈↓ αx;Recall that errors do (setq // errlist) so lambda-binding
␈↓ α_␈↓α␈↓ αx; errlist will work properly.
␈↓ α_␈↓α␈↓ αx (mapc (function eval) //)
␈↓ α_␈↓α␈↓ αx (setq * '*) ;will print * as greeting
␈↓ α_␈↓α␈↓ αx (do ((eof (list nil))) (nil)
␈↓ α_␈↓α␈↓ αx (setq * (cond ((status toplevel)
␈↓ α_␈↓α␈↓ αx (eval (status toplevel)))
␈↓ α_␈↓α␈↓ αx (t (print *)
␈↓ α_␈↓α␈↓ αx (do ((form (read eof)
␈↓ α_␈↓α␈↓ αx (read eof)))
␈↓ α_␈↓α␈↓ αx ((not (eq form eof))
␈↓ α_␈↓α␈↓ αx (setq - form))
␈↓ α_␈↓α␈↓ αx (terpri))
␈↓ α_␈↓α␈↓ αx ((lambda (+) (eval -))
␈↓ α_␈↓α␈↓ αx (prog2 nil + (setq + -)))))))
␈↓ α_␈↓which␈α⊃causes␈α⊃a␈α⊃"read-eval-print␈α⊂loop,"␈α⊃i.e.␈α⊃each␈α⊃S-expression␈α⊂that␈α⊃is␈α⊃typed␈α⊃in␈α⊂gets
␈↓ α_␈↓evaluated␈α∞and␈α
the␈α∞value␈α
is␈α∞printed,␈α
then␈α∞the␈α
next␈α∞S-expression␈α
is␈α∞read.␈α∞ Notice␈α
that
␈↓ α_␈↓there␈α
is␈α
a␈α
place␈α
in␈α
the␈α
middle␈α
where␈α
the␈α
user␈α
can␈α
insert␈α
his␈α
own␈α
special␈α
form␈α∞to␈α
be
␈↓ α_␈↓evaluated, using ␈↓α(sstatus toplevel)␈↓. See the ␈↓αsstatus␈↓ function ().
␈↓ α_␈↓␈↓ αHVariables used by the top-level read-eval-print loop:
␈↓ α_␈↓␈↓α*␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓February 10, 1977␈↓ ε)␈↓∧∪3-1.␈↓␈↓
∞Page 3-1
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ β_Contains␈αthe␈αlast␈αS-expression␈αprinted␈αout␈αby␈αthe␈αread-eval-print␈αloop,␈αthat
␈↓ α_␈↓␈↓ αhis,␈α
the␈αvalue␈α
of␈α
the␈αlast␈α
form␈α
typed␈αin.␈α
After␈αan␈α
error␈α
return␈αto␈α
top␈α
level,␈αthe
␈↓ α_␈↓␈↓ αhvalue of ␈↓α*␈↓ is ␈↓α*␈↓ itself, since a star has just been typed out.
␈↓ α_␈↓␈↓α+␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_Contains␈α
the␈α
last␈αS-expression␈α
typed␈α
in.␈α
This␈αcan␈α
be␈α
used␈α
to␈αedit␈α
it␈α
or␈αto␈α
do
␈↓ α_␈↓␈↓ αhit over again.
␈↓ α_␈↓␈↓α-␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_Contains␈α⊃the␈α⊃current␈α⊂S-expression␈α⊃typed␈α⊃in.␈α⊃ This␈α⊂can␈α⊃be␈α⊃used␈α⊃by␈α⊂user-
␈↓ α_␈↓␈↓ αhwritten␈α∂error␈α∂handlers.␈α∂ It␈α∂can't␈α∂be␈α∂usefully␈α∂accessed␈α∂by␈α∂expressions␈α⊂typed␈α∂in,
␈↓ α_␈↓␈↓ αhsince it is set too soon.
␈↓ α_␈↓␈↓ αHBy␈α∞special␈α∞dispensation␈α∞the␈α∞values␈α∞of␈α∂␈↓α+␈↓,␈α∞␈↓α*␈↓,␈α∞and␈α∞␈↓α-␈↓␈α∞are␈α∞preserved␈α∞across␈α∂a␈α∞break.
␈↓ α_␈↓When␈αthe␈αbreak␈αis␈α≡rst␈αentered␈αthese␈αhave␈αthe␈αvalues␈αfor␈αthe␈αlast␈αtop-level␈αoperation,
␈↓ α_␈↓during␈α
the␈α
break␈α
they␈α∞behave␈α
the␈α
same␈α
as␈α
at␈α∞top␈α
level,␈α
and␈α
after␈α
the␈α∞break␈α
returns
␈↓ α_␈↓they are restored to the values for the top level loop.
␈↓ α_␈↓␈↓α/␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_␈↓α/␈↓␈αis␈α
used␈αto␈α
temporarily␈αhold␈α
the␈αvalue␈α
of␈α␈↓αerrlist␈↓␈α
when␈αan␈α
error␈αreturns
␈↓ α_␈↓␈↓ αhto␈α∩top␈α∩level.␈α∩ This␈α∩is␈α∩so␈α∩that␈α∩␈↓αlambda␈↓-binding␈α∩␈↓αerrlist␈↓␈α∩will␈α∩have␈α∩an␈α∩e≥ect
␈↓ α_␈↓␈↓ αh(assuming␈αno␈αone␈α␈↓αlambda␈↓-binds␈α␈↓α/␈↓).␈α Note␈αthat␈α␈↓α/␈↓␈αmust␈αbe␈αtyped␈αas␈α␈↓α//␈↓␈αsince␈αthe
␈↓ α_␈↓␈↓ αhslash character is special to LISP.
␈↓ α_␈↓␈↓αerrlist␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈αvalue␈αof␈α␈↓αerrlist␈↓␈αis␈αa␈αlist␈αof␈αforms␈αwhich␈αare␈αevaluated␈αwhen␈αcontrol
␈↓ α_␈↓␈↓ αhreturns␈α⊃to␈α⊃top␈α⊃level␈α⊂either␈α⊃because␈α⊃of␈α⊃an␈α⊂error␈α⊃or␈α⊃when␈α⊃an␈α⊃environment␈α⊂is
␈↓ α_␈↓␈↓ αhinitially␈α≥started.␈α≡ This␈α≥feature␈α≥is␈α≡used␈α≥to␈α≥provide␈α≡self-starting␈α≥LISP
␈↓ α_␈↓␈↓ αhenvironments␈α
and␈α
to␈α∞provide␈α
special␈α
error␈α∞handling␈α
for␈α
subsystems␈α∞written␈α
in
␈↓ α_␈↓␈↓ αhLISP.
␈↓ α_␈↓␈↓ β_The␈α∞symbol␈α∞␈↓αerrlist␈↓␈α∞is␈α∞evaluated␈α∞to␈α∞get␈α∞the␈α∞list␈α∞of␈α∞forms␈α∞in␈α∂the␈α∞binding
␈↓ α_␈↓␈↓ αhcontext␈αin␈αwhich␈αthe␈αerror␈αoccurred,␈αbut␈αthe␈αforms␈αthemselves␈αare␈αevaluated␈αin
␈↓ α_␈↓␈↓ αhthe top-level binding context.
␈↓ α_␈↓Page 3-2␈↓ ε ␈↓∧∪3-1.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.2 Break Points␈↓
␈↓ α_␈↓␈↓ αHBreak␈αpoints␈αare␈αa␈αmechanism␈αto␈αallow␈αthe␈αuser␈αto␈αgain␈αcontrol␈αat␈αany␈αpoint␈αin␈αa
␈↓ α_␈↓program.␈α Use␈αof␈αthe␈αfunction␈α␈↓αbreak␈↓␈αcauses␈αa␈αread-eval-print␈αloop,␈αsimilar␈αto␈αthe␈α
one
␈↓ α_␈↓at␈α
top␈α
level,␈αto␈α
be␈α
entered.␈α (This␈α
is␈α
also␈αcalled␈α
a␈α
␈↓↓break␈αloop␈↓.)␈α
The␈α
user␈α
may␈αevaluate
␈↓ α_␈↓any␈αS-expressions,␈αand␈αthen␈α
cause␈αthe␈αbreak␈αto␈α
return,␈αpossibly␈αwith␈αa␈αvalue.␈α
Normal
␈↓ α_␈↓execution then proceeds.
␈↓ α_␈↓␈↓ αHThis␈α↔mechanism␈α↔can␈α_be␈α↔used␈α↔to␈α↔allow␈α_for␈α↔human␈α↔intervention␈α_when␈α↔an
␈↓ α_␈↓unexpected␈α
condition␈α
occurs.␈α
It␈αis␈α
used␈α
in␈α
this␈α
way␈αby␈α
the␈α
MACLISP␈α
error␈αsystem.␈α
A
␈↓ α_␈↓break loop makes the full power of the LISP interpreter available for debugging.
␈↓ α_␈↓␈↓αbreak␈↓ ∧XFSUBR␈↓
␈↓ α_␈↓␈↓ β_␈↓α(break␈α
␈↓↓tag␈α
pred␈↓α)␈↓␈α
evaluates␈α
␈↓↓pred␈↓,␈α
but␈α
not␈α
␈↓↓tag␈↓.␈α
If␈α
the␈α
value␈α
of␈α
␈↓↓pred␈↓␈α
is␈αnot
␈↓ α_␈↓␈↓ αh␈↓αnil␈↓,␈αthe␈αstate␈αof␈αthe␈αI/O␈αsystem␈αis␈αsaved,␈α"␈↓α;bkpt␈α␈↓↓tag␈↓"␈αis␈αtyped␈αout,␈αand␈αcontrol
␈↓ α_␈↓␈↓ αhreturns␈αto␈αthe␈αterminal.␈α We␈αsay␈αthat␈αa␈α"break␈αloop"␈αhas␈αbeen␈αentered.␈α ␈↓↓tag␈↓␈α
may
␈↓ α_␈↓␈↓ αhbe␈α
any␈α
object.␈α
It␈α
is␈α
used␈α
only␈α
as␈α
a␈α
message␈α
typed␈α
out␈α
to␈α
identify␈α
the␈α
break.␈α
It␈α
is
␈↓ α_␈↓␈↓ αhnot evaluated.
␈↓ α_␈↓␈↓ β_Forms␈α⊃may␈α∩be␈α⊃typed␈α⊃in␈α∩and␈α⊃evaluated␈α∩as␈α⊃at␈α⊃top␈α∩level.␈α⊃ ␈↓αbreak␈↓␈α∩does␈α⊃an
␈↓ α_␈↓␈↓ αh␈↓αerrset␈↓ so that errors cannot cause an abnormal return from the ␈↓αbreak␈↓.
␈↓ α_␈↓␈↓ β_If␈α␈↓α$p␈↓␈αis␈αtyped␈αin,␈α␈↓αbreak␈↓␈αreturns␈α␈↓αnil␈↓␈αand␈αexecution␈αcontinues.␈α This␈α"␈↓α$p␈↓"␈αis
␈↓ α_␈↓␈↓ αh<dollar>␈α
p␈α
<newline>␈α
in␈α∞the␈α
Multics␈α
implementation,␈α
but␈α
<altmode>␈α∞P␈α
<space>
␈↓ α_␈↓␈↓ αhin the pdp-10 implementations.
␈↓ α_␈↓␈↓ β_If␈α␈↓α(return␈α␈↓↓x␈↓α)␈↓␈αis␈αtyped␈αin,␈α␈↓αbreak␈↓␈αevaluates␈α␈↓↓x␈↓␈αand␈αreturns␈αthat␈αvalue.␈α If␈αas
␈↓ α_␈↓␈↓ αha␈α∞result␈α
of␈α∞the␈α
evaluation␈α∞of␈α
a␈α∞typed-in␈α
form,␈α∞␈↓α(throw␈α
␈↓↓x␈↓α␈α∞break)␈↓␈α∞is␈α
evaluated,
␈↓ α_␈↓␈↓ αh␈↓αbreak␈↓ returns ␈↓↓x␈↓ as its value.
␈↓ α_␈↓␈↓ β_When ␈↓αbreak␈↓ returns, the state of the I/O system is restored.
␈↓ α_␈↓␈↓ β_An␈α
approximate␈αLISP␈α
de≡nition␈α
of␈αwhat␈α
␈↓αbreak␈↓␈α
does␈αfollows.␈α
Note␈αthat␈α
the
␈↓ α_␈↓␈↓ αhuser program can get its paws into this by using ␈↓α(sstatus breaklevel)␈↓.
␈↓ α_␈↓February 10, 1977␈↓ ε ␈↓∧∪3-1.2␈↓␈↓
Page 3-3
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓α(defun break fexpr (x)
␈↓ α_␈↓α (*break (eval (cadr x)) (car x)) ;note arg reversal
␈↓ α_␈↓α(declare (special ↑q ↑w evalhook * + -))
␈↓ α_␈↓α(defun *break (breakp breakid)
␈↓ α_␈↓α (and breakp
␈↓ α_␈↓α (do ((↑q nil) (↑w nil) (evalhook nil) (* *) (+ +) (- -))
␈↓ α_␈↓α () ;bind key variables
␈↓ α_␈↓α (terpri)
␈↓ α_␈↓α (princ '/;bkpt/ )
␈↓ α_␈↓α (princ breakid)
␈↓ α_␈↓α (setq + -) ;last form typed
␈↓ α_␈↓α (return
␈↓ α_␈↓α (catch
␈↓ α_␈↓α (do nil (nil) ;do forever (until throw)
␈↓ α_␈↓α (errset
␈↓ α_␈↓α (do ((eof (list nil)) (form))
␈↓ α_␈↓α (nil)
␈↓ α_␈↓α (cond ((status breaklevel)
␈↓ α_␈↓α (eval (status breaklevel)))
␈↓ α_␈↓α (t (setq form (read eof))
␈↓ α_␈↓α (cond ((eq form eof) (terpri))
␈↓ α_␈↓α ((eq form '$p) (throw nil break))
␈↓ α_␈↓α ((eq (car form) 'return)
␈↓ α_␈↓α (throw (eval (cadr form)) break))
␈↓ α_␈↓α (t (setq - form)
␈↓ α_␈↓α (print
␈↓ α_␈↓α (setq * ((lambda (+) (eval form))
␈↓ α_␈↓α (prog2 nil + (setq + -)))))
␈↓ α_␈↓α (terpri))))))))
␈↓ α_␈↓α break)
␈↓ α_␈↓α ))))
␈↓ α_␈↓␈↓ αHThe␈α
arguments␈α∞to␈α
␈↓αbreak␈↓␈α∞are␈α
a␈α
breakpoint␈α∞identi≡cation␈α
and␈α∞a␈α
break␈α∞switch.␈α
If
␈↓ α_␈↓the␈α
break␈α
switch␈α
is␈α
␈↓αnil␈↓,␈α
then␈α
␈↓αnil␈↓␈α
is␈α
returned.␈α
Otherwise,␈α
the␈α
variables␈α
␈↓α↑q␈↓,␈α
␈↓α↑w␈↓,␈α
and
␈↓ α_␈↓␈↓αevalhook␈↓␈α∂are␈α∂bound␈α∂to␈α∂␈↓αnil␈↓,␈α∂the␈α∂variables␈α∂␈↓α*␈↓,␈α∂␈↓α+␈↓,␈α∂and␈α∂␈↓α-␈↓␈α∂are␈α∂bound␈α∂to␈α∂their␈α∂current
␈↓ α_␈↓values,␈α∪and␈α∀the␈α∪message␈α∀"␈↓α;bkpt␈α∪<breakid>␈↓"␈α∪is␈α∀printed.␈α∪ A␈α∀read-eval-print␈α∪loop
␈↓ α_␈↓similar␈α∞to␈α∞the␈α
top␈α∞level␈α∞loop␈α∞is␈α
then␈α∞entered.␈α∞ This␈α∞break␈α
loop␈α∞is␈α∞surrounded␈α∞by␈α
an
␈↓ α_␈↓␈↓αerrset␈↓.␈α Errors␈αmerely␈αcause␈αthe␈αbreak␈αloop␈αto␈αbe␈αre-entered.␈α The␈αvalue␈αof␈α␈↓α(status
␈↓ α_␈↓αbreaklevel)␈↓␈α⊂serves␈α⊂a␈α⊂function␈α∂similar␈α⊂to␈α⊂that␈α⊂of␈α∂␈↓α(status␈α⊂toplevel)␈↓␈α⊂in␈α⊂the␈α∂top
␈↓ α_␈↓level loop.
␈↓ α_␈↓Page 3-4␈↓ ε ␈↓∧∪3-1.2␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αHAs␈α
each␈α
form␈α
is␈α
read␈α∞in␈α
the␈α
default␈α
break␈α
loop,␈α∞there␈α
are␈α
four␈α
cases:␈α
1.␈α∞ End␈α
of
␈↓ α_␈↓≡le.␈α This␈αindicates␈αover-rubout␈αand␈αsimply␈αcauses␈αa␈αterpri.␈α 2.␈α The␈αform␈αis␈αthe␈αatom
␈↓ α_␈↓␈↓α$p␈↓.␈α∪ ␈↓αnil1␈α∪is␈α∀returned␈α∪from␈α∪the␈α∪break.␈α∀ 3.␈α∪ The␈α∪form␈α∪is␈α∀(return␈α∪␈↓↓value␈↓α)␈↓.
␈↓ α_␈↓The␈αform␈α␈↓↓value␈↓␈αis␈αevaluated␈αand␈αreturned␈α
from␈αthe␈αbreak.␈α 4.␈α Otherwise␈αthe␈αform␈α
is
␈↓ α_␈↓evaluated␈α
and␈α
the␈α
result␈α
printed␈α
out␈α
in␈α
a␈α
manner␈α
analogous␈α
to␈α
the␈α
top␈α
level␈α
read-eval-
␈↓ α_␈↓print␈αloop.␈α The␈αvariables␈α␈↓α+,␈α-,␈α␈↓and␈α␈↓α*␈↓␈αare␈αupdated␈αappropriately.␈α (Recall,␈αhowever,
␈↓ α_␈↓that␈α∞they␈α∞were␈α∞bound␈α∞on␈α∞entry␈α∞to␈α∞␈↓α*break␈↓,␈α∞and␈α∞so␈α∞will␈α∞be␈α∞restored␈α∂eventually.)␈α∞The
␈↓ α_␈↓way␈α
to␈α
return␈α
from␈α
a␈α∞␈↓αbreak␈↓␈α
is␈α
to␈α
do␈α
a␈α
␈↓αthrow␈↓␈α∞with␈α
a␈α
tag␈α
of␈α
␈↓αbreak␈↓;␈α
this␈α∞will␈α
return
␈↓ α_␈↓from␈α
the␈α
␈↓αcatch␈↓␈αwhich␈α
surrounds␈α
the␈α
break␈αloop.␈α
This␈α
is␈α
how␈αcases␈α
2␈α
and␈α
3␈αreturn
␈↓ α_␈↓their values; case 4 may also cause a return from the break.
␈↓ α_␈↓February 10, 1977␈↓ ε ␈↓∧∪3-1.2␈↓␈↓
Page 3-5
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.3 Control Characters␈↓
␈↓ α_␈↓␈↓ αHLISP␈αcan␈αbe␈αdirected␈αto␈αtake␈αcertain␈αactions␈αby␈αentering␈α"control␈αcharacters"␈αfrom
␈↓ α_␈↓the␈α⊂terminal.␈α⊂ The␈α⊃di≥erence␈α⊂between␈α⊂control␈α⊂characters␈α⊃and␈α⊂normal␈α⊂input␈α⊃is␈α⊂that
␈↓ α_␈↓control␈α
characters␈α
take␈α
e≥ect␈α
as␈α
soon␈α
as␈α
they␈α
are␈α
entered␈α
while␈α
normal␈α
input␈α
only␈α
takes
␈↓ α_␈↓e≥ect␈αwhen␈α
LISP␈αasks␈α
for␈αit,␈α
by␈αuse␈αof␈α
functions␈αsuch␈α
as␈α␈↓αread␈↓,␈α
or␈αby␈α
being␈αin␈αthe␈α
top
␈↓ α_␈↓level read-eval-print loop or in a break loop.
␈↓ α_␈↓␈↓ αHControl␈α
characters␈αcan␈α
be␈α
typed␈αin␈α
from␈α
the␈αterminal␈α
according␈α
to␈αsome␈α
procedure
␈↓ α_␈↓that␈αdepends␈αon␈αthe␈αimplementation.␈α A␈αprogram␈αcan␈αmimic␈αthe␈αe≥ects␈αof␈αthe␈α
various
␈↓ α_␈↓control characters by using the function ␈↓αioc␈↓.
␈↓ α_␈↓␈↓ αHAlthough␈αcontrol␈αcharacters␈α
are␈αusually␈αprocessed␈αas␈α
soon␈αas␈αthey␈αare␈α
typed,␈αthey
␈↓ α_␈↓will␈α_be␈α↔delayed␈α_if␈α↔there␈α_is␈α↔a␈α_garbage␈α↔collection␈α_in␈α↔progress␈α_or␈α↔LISP␈α_is␈α↔in
␈↓ α_␈↓␈↓α(nointerrupt tty)␈↓ mode - see the ␈↓αnointerrupt␈↓ function.
␈↓ α_␈↓␈↓ β+␈↓βEntering Control Characters in ITS LISP␈↓
␈↓ α_␈↓␈↓ αHIn␈αthe␈α
ITS␈αimplementation␈αof␈α
MACLISP,␈αcontrol␈αcharacters␈α
are␈αentered␈αby␈α
means
␈↓ α_␈↓of␈α∞the␈α∞"CTRL"␈α∞key␈α∞on␈α∞the␈α∞terminal.␈α∞ For␈α∞example,␈α∞CTRL/G␈α∞is␈α∞entered␈α∞by␈α
holding
␈↓ α_␈↓down␈α
"CTRL"␈α
and␈α
striking␈α
the␈α
"G"␈α
key.␈α
Control␈α
characters␈α
echo␈α
as␈α
an␈α
uparrow␈α
or
␈↓ α_␈↓circum∨ex followed by the character.
␈↓ α_␈↓␈↓ β¬␈↓βEntering Control Characters in DEC-10 LISP␈↓
␈↓ α_␈↓␈↓ αHControl␈α∞characters␈α∞may␈α∞be␈α∞entered␈α∞in␈α∞the␈α
same␈α∞way␈α∞as␈α∞in␈α∞ITS␈α∞LISP␈α∞if␈α∞LISP␈α
is
␈↓ α_␈↓currently␈α∞␈↓αread␈↓'ing␈α∞from␈α∞the␈α∞terminal.␈α∞ If␈α∞a␈α∞LISP␈α∞program␈α∞is␈α∞actively␈α∞running,␈α∂it␈α∞is
␈↓ α_␈↓necessary␈α∂to␈α∂≡rst␈α∂gain␈α∂its␈α∂attention␈α⊂by␈α∂striking␈α∂control-C.␈α∂ LISP␈α∂rings␈α∂the␈α⊂bell␈α∂and
␈↓ α_␈↓types␈αa␈αquestion␈αmark␈αand␈αan␈αup-arrow,␈αprompting␈αfor␈αthe␈αentry␈αof␈αa␈αcharacter␈αto␈αbe
␈↓ α_␈↓treated␈α
as␈α
a␈αcontrol␈α
character.␈α
If␈αyou␈α
type␈α
a␈αsecond␈α
control-C␈α
you␈αwill␈α
return␈α
to␈αthe
␈↓ α_␈↓monitor.
␈↓ α_␈↓␈↓ β¬␈↓βEntering Control Characters in Multics LISP␈↓
␈↓ α_␈↓␈↓ αHIn␈α∞the␈α
Multics␈α∞implementation␈α
of␈α∞MACLISP,␈α∞one␈α
signals␈α∞one's␈α
desire␈α∞to␈α∞enter␈α
a
␈↓ α_␈↓"control"␈α⊃character␈α⊂by␈α⊃hitting␈α⊂the␈α⊃"attention"␈α⊂key␈α⊃on␈α⊂the␈α⊃terminal.␈α⊂ (This␈α⊃is␈α⊂called
␈↓ α_␈↓"break,"␈α∩"interrupt,"␈α∩"attn,"␈α⊃"quit,"␈α∩etc.␈α∩on␈α∩di≥erent␈α⊃terminals.␈α∩ If␈α∩Multics␈α∩is␈α⊃being
␈↓ α_␈↓accessed␈α⊗through␈α↔the␈α⊗ARPA␈α↔network,␈α⊗an␈α⊗"interrupt␈α↔process"␈α⊗signal␈α↔should␈α⊗be
␈↓ α_␈↓transmitted.)␈α
Lisp␈α
responds␈α
by␈α
typing␈α
out␈α
"CTRL/".␈α
Now␈α
you␈α
may␈α
type␈α
one␈α
control
␈↓ α_␈↓character,␈αa␈αletter␈αfrom␈αthe␈αlist␈αlater␈αin␈αthis␈αsection,␈αwhich␈αwill␈αbe␈αinterpreted␈αto␈αhave
␈↓ α_␈↓its "control" meaning. The control character must be followed by a newline.
␈↓ α_␈↓Page 3-6␈↓ ε ␈↓∧∪3-1.3␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αHIt␈α∂is␈α∂also␈α∂possible␈α∂to␈α⊂enter␈α∂"control"␈α∂characters␈α∂from␈α∂an␈α∂input␈α⊂character␈α∂stream,
␈↓ α_␈↓which␈αmay␈αhave␈αits␈αsource␈αat␈αthe␈αterminal␈αor␈αin␈αan␈αexec←com,␈αwithout␈αthe␈αuse␈αof␈αthe
␈↓ α_␈↓"attention"␈αkey.␈α The␈αdesired␈αcontrol␈αcharacter␈αis␈αpre≡xed␈αby␈αa␈α\036␈αcharacter.␈α If␈αtwo
␈↓ α_␈↓of␈αthese␈α
pre≡x␈αcharacters␈α
occur␈αtogether,␈α
one␈α\036␈α
character␈αis␈α
read␈αand␈α
no␈α"control"
␈↓ α_␈↓action␈α∂is␈α∂performed.␈α∂ Otherwise,␈α∂the␈α∂character␈α∂following␈α∂the␈α∂\036␈α∂is␈α∂processed␈α∂as␈α∞a
␈↓ α_␈↓control character, then reading continues.
␈↓ α_␈↓␈↓ αHControl␈α∞characters␈α
will␈α∞be␈α
accepted␈α∞in␈α
upper␈α∞or␈α
lower␈α∞case.␈α
All␈α∞characters␈α
other
␈↓ α_␈↓than␈α⊃those␈α⊃with␈α⊃de≡ned␈α⊂meanings␈α⊃are␈α⊃rejected␈α⊃with␈α⊂an␈α⊃error␈α⊃message.␈α⊃ Only␈α⊂one
␈↓ α_␈↓control␈αcharacter␈αmay␈αbe␈αentered␈αat␈αa␈αtime.␈α When␈αa␈α"user␈αinterrupt"␈αis␈αcaused,␈αif␈αthe
␈↓ α_␈↓interrupt␈α∞is␈α∞not␈α∞enabled␈α
nothing␈α∞happens.␈α∞ If␈α∞the␈α
interrupt␈α∞is␈α∞enabled,␈α∞then␈α∞a␈α
user-
␈↓ α_␈↓speci≡ed␈α_function␈α→is␈α_called.␈α→ The␈α_interrupt␈α→may␈α_be␈α→enabled␈α_by␈α→binding␈α_the
␈↓ α_␈↓appropriate␈α
symbol␈αto␈α
the␈αfunction␈α
to␈αhandle␈α
it,␈αor␈α
by␈αusing␈α
the␈α
␈↓α(sstatus␈αttyint)␈↓
␈↓ α_␈↓function ().
␈↓ α_␈↓␈↓ αxExample:
␈↓ α_␈↓␈↓ αx (lines containing user input are preceded by ␈↓α>>>)
␈↓ α_␈↓α␈↓ αx>>> (defun loop (x) (loop (add1 x)))
␈↓ α_␈↓α␈↓ αx loop
␈↓ α_␈↓α␈↓ αx>>> (loop 0)
␈↓ α_␈↓α␈↓ αx function runs for a long time,
␈↓ α_␈↓α␈↓ αx>>> <ATTN> then user hits attention button.
␈↓ α_␈↓α␈↓ αx>>> CTRL/B LISP types "CTRL/", user types "B"
␈↓ α_␈↓α␈↓ αx>>> ;bkpt ↑b system enters break loop
␈↓ α_␈↓α␈↓ αx>>> x user looks at value of x
␈↓ α_␈↓α␈↓ αx 4067
␈↓ α_␈↓α␈↓ αx>>> <ATTN> user hits attention button again
␈↓ α_␈↓α␈↓ αx>>> CTRL/G and returns to top level
␈↓ α_␈↓α␈↓ αx Quit
␈↓ α_␈↓α␈↓ αx *
␈↓ α_␈↓␈↓ β@These are the control characters that have de≡ned meanings
␈↓ α_␈↓␈↓ α8B␈↓ β8causes␈αthe␈α↑b␈αuser␈αinterrupt,␈αwhich␈αis␈αinitially␈αset␈αto␈αa␈αbreak␈αloop.␈α This␈αis
␈↓ α_␈↓␈↓ β8used to stop a running program.
␈↓ α_␈↓␈↓ α8C␈↓ β8sets␈α∪the␈α∪value␈α∪of␈α∪the␈α∪atom␈α∪␈↓α↑d␈↓␈α∪to␈α∪␈↓αnil␈↓,␈α∪turning␈α∪o≥␈α∪garbage␈α∩collector
␈↓ α_␈↓␈↓ β8messages.
␈↓ α_␈↓␈↓ α8D␈↓ β8sets the value of the atom ␈↓α↑d␈↓ to ␈↓αt␈↓, turning on garbage collector messages.
␈↓ α_␈↓February 10, 1977␈↓ ε ␈↓∧∪3-1.3␈↓␈↓
Page 3-7
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ α8G␈↓ β8quits␈αback␈αto␈αthe␈αtop␈αlevel␈αof␈αlisp,␈αrebinding␈αall␈αvariables␈αto␈α
their␈αglobal
␈↓ α_␈↓␈↓ β8values,␈α⊂resetting␈α⊂various␈α⊂system␈α∂variables,␈α⊂and␈α⊂evaluating␈α⊂the␈α∂␈↓αerrlist␈↓
␈↓ α_␈↓␈↓ β8forms.␈α∀ This␈α∀is␈α∀used␈α∪to␈α∀stop␈α∀a␈α∀running␈α∪program␈α∀when␈α∀there␈α∀is␈α∪no
␈↓ α_␈↓␈↓ β8intention of restarting it again.
␈↓ α_␈↓␈↓ α8Q␈↓ β8sets␈α∩the␈α∩value␈α∩of␈α∩the␈α∩atom␈α⊃␈↓α↑q␈↓␈α∩to␈α∩␈↓αt␈↓,␈α∩enabling␈α∩input␈α∩from␈α∩the␈α⊃source
␈↓ α_␈↓␈↓ β8selected by the value of ␈↓αin≡le␈↓, or selected by use of the function ␈↓αuread␈↓.
␈↓ α_␈↓␈↓ α8R␈↓ β8sets␈α∞the␈α∞value␈α∞of␈α∂the␈α∞atom␈α∞␈↓α↑r␈↓␈α∞to␈α∂␈↓αt␈↓,␈α∞enabling␈α∞output␈α∞to␈α∂the␈α∞destinations
␈↓ α_␈↓␈↓ β8selected␈α⊃by␈α⊃the␈α⊃value␈α⊃of␈α⊃␈↓αout≡les␈↓,␈α⊂or␈α⊃selected␈α⊃by␈α⊃use␈α⊃of␈α⊃the␈α⊂␈↓αuwrite␈↓
␈↓ α_␈↓␈↓ β8function.
␈↓ α_␈↓␈↓ α8S␈↓ β8turns␈αo≥␈αtypeout␈αuntil␈αinput␈αis␈αread.␈α This␈αis␈αused␈αto␈αsuppress␈αthe␈αrest␈αof
␈↓ α_␈↓␈↓ β8the␈α
typeout␈α
from␈α
the␈α
current␈α
request,␈α
without␈α
e≥ecting␈α
typeout␈α∞from␈α
the
␈↓ α_␈↓␈↓ β8next␈α
request␈α
that␈α
is␈α
typed␈α
in.␈α
It␈α
is␈α
implemented␈α
by␈α
setting␈α
␈↓α↑w␈↓␈α
to␈α∞␈↓αt␈↓␈α
then
␈↓ α_␈↓␈↓ β8putting␈αa␈αmacro␈αcharacter␈αin␈αthe␈α
input␈αstream␈αwhich␈αsets␈α␈↓α↑w␈↓␈αto␈α␈↓αnil␈↓␈α
when
␈↓ α_␈↓␈↓ β8it is read.
␈↓ α_␈↓␈↓ α8T␈↓ β8sets␈αthe␈αvalue␈αof␈αthe␈αatom␈α␈↓α↑r␈↓␈αto␈α␈↓αnil␈↓,␈αdisabling␈αoutput␈αto␈αthe␈αdestinations
␈↓ α_␈↓␈↓ β8that CTRL/r enables.
␈↓ α_␈↓␈↓ α8U␈↓ β8causes the current call to ␈↓αread␈↓ to be restarted from the beginning.
␈↓ α_␈↓␈↓ α8V␈↓ β8sets the value of the atom ␈↓α↑w␈↓ to ␈↓αnil␈↓, enabling output to the terminal.
␈↓ α_␈↓␈↓ α8W␈↓ β8sets the value of the atom ␈↓α↑w␈↓ to␈↓α t␈↓, disabling output to the terminal.
␈↓ α_␈↓␈↓ α8X␈↓ β8causes␈α∞an␈α∞error␈α∞which␈α
can␈α∞be␈α∞caught␈α∞by␈α
␈↓αerrset␈↓.␈α∞ This␈α∞is␈α∞a␈α∞less␈α
drastic
␈↓ α_␈↓␈↓ β8"quit" than ctrl/G.
␈↓ α_␈↓␈↓ α8Z␈↓ β8On␈αITS␈αreturns␈αto␈αITS␈αcommand␈αlevel,␈αi.e.␈αDDT.␈α On␈αMultics␈αreturns␈αto
␈↓ α_␈↓␈↓ β8Multics␈αcommand␈αlevel.␈α(start␈αre-enters␈αlisp.)␈αOn␈αDEC-10␈αgoes␈αto␈αDDT␈αif
␈↓ α_␈↓␈↓ β8a␈α∞DDT␈α∞has␈α∞been␈α∞loaded␈α∞with␈α∞LISP.␈α∞ This␈α∞control␈α∞character␈α∞is␈α∞handled
␈↓ α_␈↓␈↓ β8immediately␈α↔even␈α↔when␈α↔LISP␈α↔is␈α↔garbage␈α↔collecting␈α↔or␈α↔running␈α↔in
␈↓ α_␈↓␈↓ β8␈↓α(nointerrupt tty)␈↓ mode, unlike most of the others.
␈↓ α_␈↓␈↓ αHThe following control characters only exist in the Multics implementation.
␈↓ α_␈↓␈↓ α( .␈↓ β8does␈αnothing,␈αused␈αto␈αspeed␈α
up␈αa␈αslow␈αprocess␈αby␈αcausing␈α
an␈αinteraction.
␈↓ α_␈↓␈↓ β8This␈α⊗control␈α⊗character␈α⊗is␈α∃handled␈α⊗immediately␈α⊗even␈α⊗when␈α⊗LISP␈α∃is
␈↓ α_␈↓␈↓ β8garbage␈α
collecting␈α
or␈α
running␈α
in␈α
(␈↓αnointerrupt␈α
tty)␈↓␈α
mode,␈α
unlike␈αmost
␈↓ α_␈↓␈↓ β8of the others.
␈↓ α_␈↓Page 3-8␈↓ ε ␈↓∧∪3-1.3␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ α8?␈↓ β8asks␈α∂the␈α⊂LISP␈α∂subsystem␈α∂what␈α⊂it␈α∂is␈α∂doing:␈α⊂running,␈α∂waiting␈α⊂for␈α∂input,
␈↓ α_␈↓␈↓ β8collecting␈α∃garbage,␈α∃or␈α∃running␈α∃with␈α∃tty-interrupts␈α∃masked␈α∃o≥.␈α∃ This
␈↓ α_␈↓␈↓ β8control␈α⊃character␈α⊃is␈α⊃handled␈α⊃immediately␈α⊃even␈α⊃when␈α⊃LISP␈α⊃is␈α⊃garbage
␈↓ α_␈↓␈↓ β8collecting␈α∂or␈α∞running␈α∂in␈α∞␈↓α(nointerrupt␈α∂tty)␈↓␈α∞mode,␈α∂unlike␈α∞most␈α∂of␈α∞the
␈↓ α_␈↓␈↓ β8others.
␈↓ α_␈↓␈↓ αHThe␈α∂following␈α∂control␈α∂characters␈α∂only␈α∂exist␈α∂in␈α∂pdp-10␈α∂implementations␈α∂with␈α∞the
␈↓ α_␈↓"moby I/O" capability.
␈↓ α_␈↓␈↓ α8F␈↓ β8cause display slave to seize a display.
␈↓ α_␈↓␈↓ α8N␈↓ β8turn on display.
␈↓ α_␈↓␈↓ α8O␈↓ β8turn o≥ display.
␈↓ α_␈↓␈↓ α8Y␈↓ β8interrogate display slave.
␈↓ α_␈↓␈↓ αHThe following control characters only work in the pdp-10 implementation.
␈↓ α_␈↓␈↓ α8K␈↓ β8redisplay␈αthe␈αcurrent␈αinput.␈α This␈αallows␈αyou␈αto␈αget␈αa␈αclean␈αcopy␈αof␈αyour
␈↓ α_␈↓␈↓ β8input after rubouts have been used.
␈↓ α_␈↓␈↓ α8L␈↓ β8erases the screen if the terminal is a display, then does a control-K.
␈↓ α_␈↓␈↓ α8U␈↓ β8if␈α
the␈α
terminal␈α
is␈α
a␈α
display,␈α
and␈α
in␈α
␈↓α(sstatus␈α
pagepause␈α
t)␈↓␈α
mode,␈α
and
␈↓ α_␈↓␈↓ β8the␈αend␈αof␈α
the␈αscreen␈αhas␈α
been␈αreached,␈αtyping␈α
control-U␈αwill␈αtell␈α
lisp␈αto
␈↓ α_␈↓␈↓ β8continue typing out.
␈↓ α_␈↓β␈↓ ∧3Control-Character Functions
␈↓ α_␈↓␈↓αioc␈↓ ∧XFSUBR␈↓
␈↓ α_␈↓␈↓ β_The␈α∞argument␈α∞to␈α∞␈↓αioc␈↓␈α∞is␈α∞processed␈α∞as␈α∞if␈α∞it␈α∞were␈α∞a␈α∞"control␈α∂character"␈α∞that
␈↓ α_␈↓␈↓ αhhad␈αbeen␈αtyped␈αin.␈α Numbers␈αare␈α
taken␈αas␈αa␈αwhole,␈αatomic␈αsymbols'␈αpnames␈α
are
␈↓ α_␈↓␈↓ αhprocessed␈α∞character␈α
by␈α∞character,␈α∞except␈α
that␈α∞␈↓αnil␈↓␈α
causes␈α∞an␈α∞immediate␈α
return.
␈↓ α_␈↓␈↓ αhExamples:
␈↓ α_␈↓February 10, 1977␈↓ ε ␈↓∧∪3-1.3␈↓␈↓
Page 3-9
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ β8␈↓α(ioc 1)␈↓ causes user interrupt 1.
␈↓ α_␈↓␈↓ β8␈↓α(ioc vt)␈↓ switches output to the terminal.
␈↓ α_␈↓␈↓ β8␈↓α(ioc q)␈↓ switches input to a ≡le.
␈↓ α_␈↓␈↓ β8␈↓α(ioc g)␈↓ quits back to the top level of lisp.
␈↓ α_␈↓␈↓ β_If ␈↓αioc␈↓ returns, its value is ␈↓αt␈↓.
␈↓ α_␈↓␈↓αiog␈↓ ∧XFSUBR␈↓
␈↓ α_␈↓␈↓ β_␈↓αiog␈↓␈α∂≡rst␈α∂saves␈α∂the␈α∞values␈α∂of␈α∂the␈α∂I/O␈α∂switches␈α∞␈↓α↑q,␈α∂↑r,␈α∂␈↓and␈↓α␈α∂↑w␈↓.␈α∂ Then␈α∞it
␈↓ α_␈↓␈↓ αhprocesses␈αits␈α≡rst␈αargument␈αthe␈αsame␈αas␈α␈↓αioc␈↓.␈α Next␈αthe␈αremaining␈αarguments␈αto
␈↓ α_␈↓␈↓ αh␈↓αiog␈↓␈α∂are␈α∂evaluated,␈α∂from␈α∂left␈α∂to␈α∂right.␈α∂ The␈α∂values␈α∂of␈α∂the␈α∂variables␈α∂␈↓α↑q,␈α∂↑r,
␈↓ α_␈↓α␈↓ αh␈↓and␈↓α ↑w␈↓ are restored, and the value of the last argument is returned. Example:␈↓α
␈↓ α_␈↓α␈↓ ∧`(iog vt (princ "A Message."))
␈↓ α_␈↓α␈↓ αh␈↓gets␈α⊃a␈α⊃message␈α∩to␈α⊃the␈α⊃console␈α∩no␈α⊃matter␈α⊃what␈α⊃the␈α∩I/O␈α⊃system␈α⊃is␈α∩doing.␈α⊃ It
␈↓ α_␈↓␈↓ αhevaluates to ␈↓α"A Message."␈↓
␈↓ α_␈↓Page 3-10␈↓ ε ␈↓∧∪3-1.3␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.4 Exceptional Condition Handling␈↓
␈↓ α_␈↓␈↓β1.4.1 The LISP Error System␈↓
␈↓ α_␈↓␈↓ αHThe␈α∞errors␈α∞detected␈α∞by␈α∞the␈α∞LISP␈α∞system␈α∞are␈α∞divided␈α∞into␈α∞two␈α∞types:␈α
correctable
␈↓ α_␈↓and␈α⊂uncorrectable.␈α⊂ The␈α⊂uncorrectable␈α⊂errors␈α⊂will␈α⊂be␈α⊂explained␈α⊂≡rst␈α⊂since␈α⊂they␈α⊂are
␈↓ α_␈↓simpler.
␈↓ α_␈↓␈↓ αHAn␈αuncorrectable␈αerror␈αis␈αan␈αerror␈α
that␈αcauses␈αthe␈αdestruction␈αof␈αthe␈αevaluation␈α
in
␈↓ α_␈↓which␈α⊂it␈α⊂occurs.␈α⊂ An␈α⊂example␈α⊂of␈α⊂an␈α⊂uncorrectable␈α⊂error␈α⊂is␈α⊂illegal␈α⊂format␈α⊂in␈α⊂a␈α∂␈↓αdo␈↓.
␈↓ α_␈↓When␈α
an␈αuncorrectable␈α
error␈αoccurs,␈α
the␈α≡rst␈α
thing␈α
that␈αhappens␈α
is␈αthe␈α
printing␈αof␈α
an
␈↓ α_␈↓error␈α⊂message.␈α⊃ The␈α⊂error␈α⊃message␈α⊂goes␈α⊂to␈α⊃the␈α⊂terminal␈α⊃and␈α⊂nowhere␈α⊃else␈α⊂(except
␈↓ α_␈↓echo≡les),␈α
no␈αmatter␈α
how␈α
the␈αI/O␈α
switches␈αand␈α
variables␈α
are␈αset.␈α
The␈α
error␈αmessage
␈↓ α_␈↓consists␈α∂of␈α∂some␈α∂explanatory␈α∂text␈α∂and␈α∞(usually)␈α∂the␈α∂object␈α∂or␈α∂form␈α∂that␈α∂caused␈α∞the
␈↓ α_␈↓error.
␈↓ α_␈↓␈↓ αHAfter␈α
the␈α∞error␈α
message␈α∞has␈α
been␈α∞printed,␈α
control␈α∞is␈α
returned␈α∞to␈α
the␈α∞most␈α
recent
␈↓ α_␈↓error-catcher.␈α There␈αis␈αan␈αerror-catcher␈αat␈αtop␈αlevel,␈αand␈αerror-catchers␈αare␈αset␈αup␈αby
␈↓ α_␈↓the␈α∂functions␈α⊂␈↓αerrset␈↓␈α∂and␈α⊂␈↓αbreak␈↓.␈α∂ All␈α∂variable␈α⊂bindings␈α∂between␈α⊂the␈α∂error-catcher
␈↓ α_␈↓and␈αthe␈αpoint␈αwhere␈αthe␈αerror␈αoccurred␈αare␈αrestored.␈α Thus␈αall␈αvariables␈αare␈αrestored
␈↓ α_␈↓to␈α
the␈α
values␈α
they␈α
had␈α
at␈α
top␈α
level␈αor␈α
at␈α
the␈α
time␈α
the␈α
␈↓αerrset␈↓␈α
was␈α
done,␈α
unless␈αthey
␈↓ α_␈↓were ␈↓αsetq␈↓'ed free (without being bound).
␈↓ α_␈↓␈↓ αHWhat␈α
happens␈α
next␈α
depends␈α∞on␈α
how␈α
the␈α
error-catcher␈α∞was␈α
set␈α
up.␈α
At␈α∞top␈α
level,
␈↓ α_␈↓␈↓α(mapc␈α'eval␈αerrlist)␈↓␈αis␈αdone,␈αa␈α␈↓α*␈↓␈αis␈αtyped,␈αand␈αthe␈αread-eval-print␈αloop␈α(or␈αa␈αuser
␈↓ α_␈↓speci≡ed␈α⊃top␈α⊃level␈α⊃form)␈α⊃is␈α⊃re-entered.␈α⊃ (␈↓αerrlist␈↓␈α⊃is␈α⊃evaluated␈α⊃prior␈α⊃to␈α⊃the␈α⊂above
␈↓ α_␈↓restoration␈α
of␈αbindings.)␈α
If␈αan␈α
error␈αreturns␈α
to␈α␈↓αbreak␈↓,␈α
it␈αsimply␈α
re-enters␈αits␈α
read-eval-
␈↓ α_␈↓print␈αloop.␈α In␈αthe␈αMultics␈αimplementation␈αthe␈αfact␈αthat␈α␈↓αbreak␈↓␈αhas␈αcaught␈αan␈αerror␈αis
␈↓ α_␈↓signalled␈αby␈αringing␈αthe␈αbell␈αon␈αthe␈αterminal.␈α If␈αan␈αerror␈αreturns␈αto␈α␈↓αerrset␈↓,␈α␈↓αerrset␈↓
␈↓ α_␈↓returns␈α␈↓αnil␈↓␈αand␈αevaluation␈αproceeds.␈α If␈αan␈αerror␈αreturns␈αto␈αtop␈αlevel,␈αthe␈αstate␈αof␈αthe
␈↓ α_␈↓world is reset and ␈↓α*␈↓ is typed.
␈↓ α_␈↓␈↓ αHThe␈αabove␈αdescription␈αis␈α
slightly␈αsimpli≡ed.␈α It␈αis␈α
possible␈αfor␈αa␈αuser␈α
interrupt␈αto
␈↓ α_␈↓occur␈αbetween␈αthe␈αtyping␈αof␈αthe␈αmessage␈αand␈αthe␈αunwinding␈αof␈αbindings␈α
and␈αreturn
␈↓ α_␈↓of␈α∞control␈α∞to␈α∞an␈α∞error-catcher.␈α∞ This␈α∂user␈α∞interrupt␈α∞is␈α∞normally␈α∞a␈α∞break␈α∂loop␈α∞which
␈↓ α_␈↓allows␈α
the␈α
user␈α
to␈α
examine␈α
the␈α
values␈α
of␈α
variables␈α
before␈α
the␈α
bindings␈α
are␈αrestored,␈α
in
␈↓ α_␈↓hope␈α
of␈α≡nding␈α
the␈α
cause␈αof␈α
the␈α
error.␈α If␈α
the␈α
error␈αis␈α
going␈α
to␈αreturn␈α
to␈α
top␈αlevel,␈α
the
␈↓ α_␈↓␈↓α*rset-trap␈↓␈αuser␈αinterrupt␈αis␈αsignalled.␈α In␈α␈↓α(*rset␈αt)␈↓␈αmode␈αa␈αbreak␈αloop␈αis␈αentered,
␈↓ α_␈↓but␈α∩in␈α∩␈↓α(*rset␈α∩nil)␈↓␈α∩mode␈α∩the␈α∩user␈α∩interrupt␈α∩is␈α∩ignored␈α∩by␈α∩the␈α∩system␈α⊃supplied
␈↓ α_␈↓February 10, 1977␈↓ ε ␈↓∧∪3-1.4␈↓␈↓
¬Page 3-11
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓handler.␈α
If␈α
the␈α
error␈α
is␈α
going␈α
to␈α∞return␈α
to␈α
a␈α
␈↓αbreak␈↓␈α
or␈α
an␈α
␈↓αerrset␈↓,␈α
the␈α∞␈↓αerrset␈↓␈α
user
␈↓ α_␈↓interrupt␈α∪is␈α∩signalled.␈α∪ The␈α∪initial␈α∩environment␈α∪contains␈α∪a␈α∩null␈α∪handler␈α∪for␈α∩this
␈↓ α_␈↓interrupt, but the user may supply a break loop or other handler.
␈↓ α_␈↓␈↓ αHCorrectable␈α⊂errors␈α⊂are␈α⊂errors␈α⊂which␈α⊂may␈α⊂be␈α⊂corrected␈α⊂by␈α⊂user␈α⊃intervention.␈α⊂ If
␈↓ α_␈↓such␈α∪an␈α∪error␈α∩is␈α∪properly␈α∪corrected,␈α∩evaluation␈α∪will␈α∪proceed␈α∩as␈α∪if␈α∪no␈α∪error␈α∩had
␈↓ α_␈↓occurred.␈α If␈αthe␈αoption␈αto␈αcorrect␈αthe␈αerror␈αis␈αnot␈αexercised,␈αthis␈αtype␈αof␈αerror␈αwill␈αbe
␈↓ α_␈↓handled the same as an uncorrectable error.
␈↓ α_␈↓␈↓ αHWhen␈α∩a␈α∩correctable␈α⊃error␈α∩occurs,␈α∩a␈α⊃user␈α∩interrupt␈α∩is␈α⊃signalled.␈α∩ See␈α∩ for␈α⊃user
␈↓ α_␈↓interrupt␈α∩channel␈α∩assignments␈α⊃for␈α∩these␈α∩errors.␈α⊃ The␈α∩initial␈α∩environment␈α⊃contains
␈↓ α_␈↓handlers␈αfor␈αthese␈αerrors␈α
which␈αprint␈αan␈αerror␈α
message␈αsimilar␈αto␈αthe␈αmessage␈α
printed
␈↓ α_␈↓for an uncorrectable error and then enter a break loop.
␈↓ α_␈↓␈↓ αHThe␈αargument␈αpassed␈αto␈αthe␈αuser␈αinterrupt␈αhandler␈αis␈αusually␈αa␈αlist␈αdescribing␈αthe
␈↓ α_␈↓error.␈α⊃ See␈α⊂section␈α⊃1.4.2␈α⊃for␈α⊂details.␈α⊃ If␈α⊂the␈α⊃user␈α⊃interrupt␈α⊂handler␈α⊃is␈α⊂␈↓αnil␈↓,␈α⊃or␈α⊃if␈α⊂it
␈↓ α_␈↓returns␈αa␈αnon-list,␈αthe␈αerror␈αis␈αtreated␈αlike␈αan␈αuncorrectable␈αerror.␈α But␈αif␈αthe␈αhandler
␈↓ α_␈↓returns␈αa␈αlist,␈αthe␈α␈↓αcar␈↓␈αof␈αthat␈αlist␈αis␈αused␈αto␈αcorrect␈αthe␈αerror␈αin␈αa␈αway␈αwhich␈αdepends
␈↓ α_␈↓on the particular error which occurred.
␈↓ α_␈↓␈↓ αHIf␈α
the␈α
most␈α
recent␈α
error-catcher␈α
is␈αnot␈α
top-level,␈α
correctable␈α
errors␈α
will␈α
be␈αtreated
␈↓ α_␈↓as␈α∞uncorrectable␈α∞errors␈α
unless␈α∞there␈α∞is␈α
a␈α∞non-null␈α∞handler␈α
for␈α∞the␈α∞␈↓αerrset␈↓␈α
interrupt.
␈↓ α_␈↓This␈α
is␈α
to␈α
prevent␈αmultiple␈α
confusing␈α
"nested"␈α
error␈αbreaks␈α
unless␈α
the␈α
user␈αindicates
␈↓ α_␈↓that he is sophisticated by setting up a handler for the ␈↓αerrset␈↓ interrupt.
␈↓ α_␈↓␈↓β1.4.2 User Interrupts␈↓
␈↓ α_␈↓␈↓ αHLISP␈αprovides␈αa␈αnumber␈αof␈α"user␈αinterrupts,"␈αwhich␈αare␈αa␈αmechanism␈αby␈αwhich␈αa
␈↓ α_␈↓user␈αprocedure␈αmay␈αtemporarily␈αgain␈αcontrol␈αwhen␈αan␈αexceptional␈αcondition␈αhappens.
␈↓ α_␈↓The␈α
exceptional␈α
conditions␈αthat␈α
use␈α
the␈α
user␈αinterrupt␈α
system␈α
include␈α
certain␈αcontrol
␈↓ α_␈↓characters,␈α
the␈α
alarmclock␈α
timers,␈α
the␈α
garbage␈α
collector,␈α
and␈α
many␈α
of␈α
the␈α∞errors␈α
that
␈↓ α_␈↓are␈α∞detected␈α∞by␈α∞the␈α∂interpreter␈α∞or␈α∞by␈α∞the␈α∂system␈α∞functions.␈α∞ Errors␈α∞detected␈α∂by␈α∞user
␈↓ α_␈↓functions can use this mechanism also.
␈↓ α_␈↓␈↓ αHThe␈α⊃user␈α∩interrupts␈α⊃are␈α⊃divided␈α∩up␈α⊃into␈α⊃several␈α∩channels.␈α⊃ Each␈α∩channel␈α⊃has
␈↓ α_␈↓associated␈αwith␈αit␈αa␈α␈↓↓service␈αfunction␈↓.␈α If␈αthe␈αservice␈αfunction␈αis␈α␈↓αnil␈↓,␈αinterrupts␈αon␈αthat
␈↓ α_␈↓channel␈αwill␈αbe␈αignored.␈α If␈αthe␈αservice␈α
function␈αis␈αnot␈α␈↓αnil␈↓,␈αit␈αis␈αa␈αfunction␈α
which␈αis
␈↓ α_␈↓called␈α∃with␈α⊗one␈α∃argument␈α∃when␈α⊗the␈α∃user-interrupt␈α∃occurs.␈α⊗ The␈α∃nature␈α⊗of␈α∃the
␈↓ α_␈↓argument␈αdepends␈αon␈αwhich␈αchannel␈αthe␈αinterrupt␈αis␈αon;␈αusually␈αit␈αis␈αan␈αS-expression
␈↓ α_␈↓which␈α
can␈αbe␈α
used␈αto␈α
localize␈αthe␈α
cause␈αof␈α
the␈αinterrupt.␈α
Some␈αuser␈α
interrupts␈αuse␈α
the
␈↓ α_␈↓Page 3-12␈↓ ε∃␈↓∧∪3-1.4.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓value␈α
returned␈α∞by␈α
the␈α
service␈α∞function␈α
to␈α
decide␈α∞what␈α
to␈α
do␈α∞about␈α
the␈α
cause␈α∞of␈α
the
␈↓ α_␈↓interrupt.
␈↓ α_␈↓␈↓ αHThe␈α
service␈αfunctions␈α
for␈αmost␈α
user␈αinterrupts␈α
are␈αkept␈α
as␈αthe␈α
values␈α
of␈αsymbols
␈↓ α_␈↓with␈αmnemonic␈αnames.␈α A␈αlist␈αof␈αthese␈αsymbols␈αis␈αon␈α.␈αThere␈αare␈αalso␈αuser␈αinterrupts
␈↓ α_␈↓for␈αcontrol␈α
characters.␈α The␈α
service␈αfunctions␈α
for␈αthese␈α
are␈αdeclared␈α
using␈α␈↓α(sstatus
␈↓ α_␈↓αttyint)␈↓. See .
␈↓ α_␈↓␈↓ αHThe␈αinitial␈α
values␈αfor␈α
the␈αservice␈αfunctions␈α
of␈αthe␈α
various␈αinterrupts␈αare␈α
provided
␈↓ α_␈↓by the system as ␈↓αbreak␈↓ loops for some interrupts and ␈↓αnil␈↓ for others.
␈↓ α_␈↓␈↓ αHThere␈αare␈αsome␈αspecial␈αconsiderations␈αfor␈αuser␈αinterrupts␈αsignalled␈α
by␈αcorrectable
␈↓ α_␈↓error␈α
conditions.␈α The␈α
argument␈α
to␈αthe␈α
service␈αfunction␈α
is␈α
a␈αdescription␈α
of␈α
the␈αerror
␈↓ α_␈↓whose␈α
exact␈α
form␈α
is␈αdescribed␈α
in␈α
the␈α
table␈αat␈α
the␈α
end␈α
of␈αthis␈α
section.␈α
If␈α
the␈αservice
␈↓ α_␈↓function␈α⊃returns␈α⊃␈↓αnil␈↓␈α⊃(or␈α⊃any␈α⊃atom),␈α⊂the␈α⊃normal␈α⊃error␈α⊃procedure␈α⊃occurs␈α⊃--␈α⊂control
␈↓ α_␈↓returns␈α∂to␈α∂the␈α∂most␈α∂recent␈α∂␈↓αerrset␈↓␈α∂or␈α∂to␈α∂top␈α∂level␈α∂if␈α∂there␈α∂was␈α∂no␈α∂␈↓αerrset␈↓.␈α⊂ If␈α∂the
␈↓ α_␈↓service␈αfunction␈αreturns␈αa␈αlist,␈αthe␈αcar␈αof␈αthe␈αlist␈αis␈αused␈αto␈αattempt␈αrecovery␈αfrom␈αthe
␈↓ α_␈↓error.␈α
The␈α
exact␈α
way␈α
that␈α
it␈α
is␈α
used␈α
is␈α
described␈α
in␈α
the␈α
table.␈α
If␈α
recovery␈αis␈α
successful
␈↓ α_␈↓execution␈α↔proceeds␈α_from␈α↔the␈α_point␈α↔where␈α_the␈α↔error␈α_occurred.␈α↔ If␈α_recovery␈α↔is
␈↓ α_␈↓unsuccessful another error is signalled.
␈↓ α_␈↓␈↓ αHHere␈αis␈αan␈αexample␈αof␈αa␈αuser␈α
interrupt␈αservice␈αfunction.␈α This␈αis␈αthe␈αone␈α
supplied
␈↓ α_␈↓by the system for unbound variable errors when the user does not specify one.
␈↓ α_␈↓α␈↓ αx(setq unbnd-vrbl
␈↓ α_␈↓α␈↓ αx (function (lambda (args)
␈↓ α_␈↓α␈↓ αx ((lambda (↑r ↑w) (errprint nil)) nil nil)
␈↓ α_␈↓α␈↓ αx ((lambda (readtable obarray)
␈↓ α_␈↓α␈↓ αx (break unbnd-vrbl t))
␈↓ α_␈↓α␈↓ αx (get 'readtable 'array)
␈↓ α_␈↓α␈↓ αx (get 'obarray 'array) ))))
␈↓ α_␈↓␈↓αalarmclock␈↓ ∧XSUBR 2 args␈↓
␈↓ α_␈↓␈↓ β_␈↓αalarmclock␈↓␈α
is␈αa␈α
function␈αfor␈α
controlling␈αtimers.␈α
It␈αcan␈α
start␈αand␈α
stop␈αtwo
␈↓ α_␈↓␈↓ αhseparate␈αtimers;␈αone␈αis␈αa␈αreal-time␈αtimer␈α(which␈αcounts␈αseconds␈αof␈αelapsed␈αtime)
␈↓ α_␈↓␈↓ αhand␈α
the␈α
other␈α
is␈αa␈α
cpu-time␈α
timer␈α
(which␈αcounts␈α
microseconds␈α
of␈α
machine␈αrun
␈↓ α_␈↓␈↓ αhtime).␈α∀ The␈α∀≡rst␈α∀argument␈α∃to␈α∀␈↓αalarmclock␈↓␈α∀indicates␈α∀which␈α∀timer␈α∃is␈α∀being
␈↓ α_␈↓␈↓ αhreferred␈α
to:␈α
it␈α
may␈α
be␈α
the␈α
atom␈α␈↓αtime␈↓␈α
to␈α
indicate␈α
the␈α
real-time␈α
timer␈α
or␈αthe␈α
atom
␈↓ α_␈↓␈↓ αh␈↓αruntime␈↓ to indicate the cpu-time timer.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.4.2␈↓␈↓
↓Page 3-13
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ β_The␈α
second␈α
argument␈α
to␈α
␈↓αalarmclock␈↓␈α
controls␈α
what␈α
is␈α
done␈α
to␈α
the␈αselected
␈↓ α_␈↓␈↓ αhtimer.␈α If␈αit␈αis␈αa␈αpositive␈α(non-bignum)␈αnumber␈αthe␈αtimer␈αis␈αstarted.␈α Thus␈αif␈α␈↓↓n␈↓
␈↓ α_␈↓␈↓ αhis␈α⊃a␈α⊂positive␈α⊃≡xnum␈α⊂or␈α⊃∨onum,␈α⊂evaluating␈α⊃␈↓α(alarmclock␈α⊂'time␈α⊃␈↓↓n␈↓α)␈↓␈α⊃sets␈α⊂the
␈↓ α_␈↓␈↓ αhreal-time␈αtimer␈αto␈αgo␈αo≥␈αin␈α␈↓↓n␈↓␈αseconds,␈αand␈α␈↓α(alarmclock␈α'runtime␈α␈↓↓n␈↓α)␈↓␈α
sets␈αthe
␈↓ α_␈↓␈↓ αhcpu-time␈α
timer␈α
to␈α
go␈α
o≥␈α
in␈α
␈↓↓n␈↓␈α
microseconds.␈α
If␈α
the␈α
timer␈α
was␈α∞already␈α
running
␈↓ α_␈↓␈↓ αhthe␈αold␈αsetting␈αis␈αlost.␈α Thus␈αat␈αany␈αgiven␈αtime␈αeach␈αtimer␈αcan␈αonly␈αbe␈αrunning
␈↓ α_␈↓␈↓ αhfor one alarm, but the two timers can run simultaneously.
␈↓ α_␈↓␈↓ β_If␈αthe␈αsecond␈α
argument␈αto␈α␈↓αalarmclock␈↓␈αis␈α
not␈αa␈αpositive␈αnumber,␈α
the␈αtimer
␈↓ α_␈↓␈↓ αhis␈α⊂shut␈α⊂o≥,␈α⊂so␈α⊂␈↓α(alarmclock␈α⊂␈↓↓x␈↓α␈α⊂nil)␈↓␈α⊂or␈α⊂␈↓α(alarmclock␈α⊂␈↓↓x␈↓α␈α⊂-1)␈↓␈α⊂shuts␈α⊂o≥␈α⊃the␈α⊂␈↓↓x␈↓
␈↓ α_␈↓␈↓ αhtimer.
␈↓ α_␈↓␈↓ β_␈↓αalarmclock␈↓ returns ␈↓αt␈↓ if it starts a timer, ␈↓αnil␈↓ if it shuts it o≥.
␈↓ α_␈↓␈↓ β_When␈αa␈αtimer␈αgoes␈αo≥,␈αthe␈α␈↓αalarmclock␈↓␈αuser␈αinterrupt␈αoccurs.␈α
The␈αservice
␈↓ α_␈↓␈↓ αhfunction␈α∂is␈α∂run␈α∞in␈α∂␈↓α(nointerrupt␈α∂t)␈↓␈α∞mode␈α∂so␈α∂that␈α∞it␈α∂can␈α∂not␈α∂be␈α∞interrupted
␈↓ α_␈↓␈↓ αhuntil␈α
it␈α
has␈α
done␈α
its␈α
thing.␈α
If␈α
it␈α
wants␈α
to␈α
allow␈α
interrupts,␈α
other␈α
timers,␈α
etc.␈α
it
␈↓ α_␈↓␈↓ αhcan␈α∂evaluate␈α∂␈↓α(nointerrupt␈α∂nil)␈↓.␈α∂ In␈α∂any␈α∂case␈α∂the␈α∂status␈α∂of␈α∂the␈α∂nointerrupt
␈↓ α_␈↓␈↓ αh∨ag␈α
will␈α
be␈α
restored␈α
when␈αthe␈α
service␈α
function␈α
returns.␈α
The␈α
argument␈αpassed
␈↓ α_␈↓␈↓ αhto␈αthe␈αuser␈αinterrupt␈αservice␈αfunction␈αis␈αa␈αlist␈αof␈αone␈αelement,␈αthe␈αatom␈α␈↓αtime␈↓␈αor
␈↓ α_␈↓␈↓ αhthe␈αatom␈α␈↓αruntime␈↓,␈α
depending␈αon␈αthe␈α≡rst␈α
argument␈αin␈αthe␈αcall␈α
to␈α␈↓αalarmclock␈↓
␈↓ α_␈↓␈↓ αhthat set up the timer. See also the function ␈↓αnointerrupt␈↓.
␈↓ α_␈↓␈↓αnointerrupt␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_␈↓α(nointerrupt␈α∪t)␈↓␈α∪shuts␈α∪o≥␈α∪LISP␈α∪interrupts.␈α∪ This␈α∪prevents␈α∪alarmclock
␈↓ α_␈↓␈↓ αhtimers␈α∪from␈α∪going␈α∩o≥␈α∪and␈α∪prevents␈α∩the␈α∪use␈α∪of␈α∩control␈α∪characters␈α∪such␈α∩as
␈↓ α_␈↓␈↓ αhCTRL/G␈α
and␈α
CTRL/B.␈α
Any␈α
of␈α
these␈α
interrupts␈α
that␈α
occur␈α
are␈α
simply␈α
saved.
␈↓ α_␈↓␈↓ αh␈↓α(nointerrupt␈α∩t)␈↓␈α⊃mode␈α∩is␈α⊃used␈α∩to␈α⊃protect␈α∩critical␈α⊃code␈α∩in␈α∩large␈α⊃subsystems
␈↓ α_␈↓␈↓ αhwritten␈α∂in␈α∂LISP.␈α∞ It␈α∂is␈α∂also␈α∂used␈α∞by␈α∂the␈α∂LISP␈α∞system␈α∂itself␈α∂to␈α∂protect␈α∞against
␈↓ α_␈↓␈↓ αhinterrupts in the garbage collector.
␈↓ α_␈↓␈↓ β_␈↓α(nointerrupt␈α
'tty)␈↓␈α
prevents␈α
control␈α
characters␈α
(typed␈α
on␈α
the␈α
"tty")␈αfrom
␈↓ α_␈↓␈↓ αhcausing␈α↔interrupts;␈α↔however,␈α↔alarmclock␈α⊗interrupts␈α↔are␈α↔still␈α↔allowed.␈α⊗ Any
␈↓ α_␈↓␈↓ αhalarmclock interrupts which were saved will now go o≥.
␈↓ α_␈↓␈↓ β_␈↓α(nointerrupt␈α
nil)␈↓␈α∞turns␈α
interrupts␈α
back␈α∞on.␈α
Any␈α
interrupts␈α∞which␈α
were
␈↓ α_␈↓␈↓ αhsaved will now get processed. This is the normal, initial state.
␈↓ α_␈↓␈↓ β_The␈α∂result␈α∂returned␈α∂from␈α∂␈↓αnointerrupt␈↓␈α∂is␈α∂the␈α∂previous␈α∂interrupt␈α∂status␈α∂-
␈↓ α_␈↓␈↓ αh␈↓αnil␈↓, ␈↓αt␈↓, or ␈↓αtty␈↓.
␈↓ α_␈↓Page 3-14␈↓ ε∃␈↓∧∪3-1.4.2␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.4.3 Table of User Interrupt Channels␈↓
␈↓ α_␈↓␈↓ αHEach␈αuser␈αinterrupt␈αchannel␈αhas␈αa␈αvariable␈αwhose␈αvalue␈αis␈αa␈αfunctional␈αform,␈αthe
␈↓ α_␈↓␈↓↓service␈αfunction␈↓␈αfor␈αthat␈α
channel.␈α The␈αname␈αof␈αthe␈α
interrupt␈αchannel␈αis␈αthe␈α
same␈αas
␈↓ α_␈↓the␈α∃name␈α∃of␈α∃the␈α∃variable.␈α∃ The␈α∃following␈α∃lists␈α∃the␈α∃user␈α∃interrupt␈α∃channels␈α∃in
␈↓ α_␈↓alphabetical␈α
order.␈α
The␈α∞argument␈α
to␈α
which␈α
the␈α∞service␈α
function␈α
is␈α
applied␈α∞and␈α
the
␈↓ α_␈↓value␈α⊃which␈α⊃it␈α∩should␈α⊃return␈α⊃are␈α⊃described.␈α∩ By␈α⊃convention,␈α⊃all␈α∩service␈α⊃functions
␈↓ α_␈↓receive␈α⊃one␈α⊃argument.␈α⊃ Some␈α⊃user␈α⊃interrupts␈α⊃are␈α⊃initially␈α⊃set␈α⊃to␈α∩a␈α⊃system-supplied
␈↓ α_␈↓handler␈αwhich␈α
binds␈αthe␈α
symbol␈α␈↓αargs␈↓␈α
to␈αthis␈α
argument␈αand␈α
enters␈αa␈α
break␈αloop.␈α
The
␈↓ α_␈↓name of the interrupt is used as the break-tag.
␈↓ α_␈↓␈↓ β_Some␈α⊃user␈α⊃interrupts␈α⊃ignore␈α⊃the␈α⊃value␈α⊃returned␈α⊃by␈α⊃the␈α⊃service␈α⊂function,
␈↓ α_␈↓␈↓ αhwhile␈αothers␈α
distinguish␈αtwo␈α
cases:␈α if␈αthe␈α
value␈αis␈α
atomic,␈αthe␈α
service␈αfunction
␈↓ α_␈↓␈↓ αhwas␈α
not␈αable␈α
to␈αrecover␈α
from␈αthe␈α
condition␈αthat␈α
caused␈αthe␈α
interrupt.␈α LISP␈α
will
␈↓ α_␈↓␈↓ αhtake␈αits␈αdefault␈αaction,␈αsuch␈αas␈αreturning␈αcontrol␈αto␈αthe␈αmost␈αrecent␈α␈↓αerrset␈↓.␈α If
␈↓ α_␈↓␈↓ αhthe␈αvalue␈αis␈αa␈αlist,␈αthe␈αcar␈αof␈αthat␈αlist␈αis␈αused␈αto␈αrecover␈αfrom␈αthe␈αcondition␈α
that
␈↓ α_␈↓␈↓ αhcaused␈α
the␈α
interrupt.␈α
It␈α
is␈α
usually␈α
a␈α
new␈α
piece␈α
of␈α
data␈α
to␈α
be␈α
used␈α
in␈α∞place␈α
of
␈↓ α_␈↓␈↓ αhthe␈αone␈α
that␈αwas␈α
being␈αcomplained␈α
about,␈αor␈α
a␈αnew␈α
form␈αto␈α
be␈αevaluated␈αin␈α
the
␈↓ α_␈↓␈↓ αhplace of the form that erred.
␈↓ α_␈↓␈↓ β_If␈αthe␈αvalue␈αof␈αthe␈αservice-function␈αvariable␈αis␈α␈↓αnil␈↓␈αinstead␈αof␈αa␈αfunctional
␈↓ α_␈↓␈↓ αhform, the user interrupt is turned o≥.
␈↓ α_␈↓␈↓αalarmclock␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α⊂value␈α⊂of␈α⊂␈↓αalarmclock␈↓␈α⊂is␈α⊂the␈α⊂service␈α⊂function␈α⊂for␈α⊂the␈α⊂user␈α⊂interrupt
␈↓ α_␈↓␈↓ αhsignalled␈α∩when␈α⊃a␈α∩timer␈α⊃set␈α∩up␈α⊃by␈α∩the␈α⊃␈↓αalarmclock␈↓␈α∩function␈α⊃goes␈α∩o≥.␈α⊃ The
␈↓ α_␈↓␈↓ αhargument␈α⊂is␈α∂the␈α⊂name␈α⊂of␈α∂the␈α⊂timer␈α∂which␈α⊂went␈α⊂o≥,␈α∂␈↓αtime␈↓␈α⊂or␈α⊂␈↓αruntime␈↓.␈α∂ The
␈↓ α_␈↓␈↓ αhreturned␈α
value␈αis␈α
ignored.␈α
The␈αservice␈α
function␈αis␈α
executed␈α
in␈α␈↓α(nointerrupt
␈↓ α_␈↓α␈↓ αht)␈↓ mode. This interrupt is initially turned o≥.
␈↓ α_␈↓␈↓αautoload␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α∩value␈α∪of␈α∩the␈α∩atom␈α∪␈↓αautoload␈↓␈α∩is␈α∩the␈α∪service␈α∩function␈α∩for␈α∪the␈α∩user
␈↓ α_␈↓␈↓ αhinterrupt␈α∪which␈α∪provides␈α∪automatic␈α∪loading␈α∪of␈α∪program␈α∪packages␈α∪into␈α∩the
␈↓ α_␈↓␈↓ αhenvironment.␈α⊂ The␈α∂argument␈α⊂is␈α∂␈↓α(␈↓↓function␈α⊂.␈α∂autoload-property␈↓α)␈↓.␈α⊂ The␈α∂returned
␈↓ α_␈↓␈↓ αhvalue␈α∞is␈α∂ignored.␈α∞ See␈α∞part␈α∂3.4␈α∞for␈α∞details.␈α∂ This␈α∞interrupt␈α∞is␈α∂initially␈α∞set␈α∂to␈α∞a
␈↓ α_␈↓␈↓ αhfunction which simply loads a ≡le.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.4.3␈↓␈↓
↓Page 3-15
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αerrset␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈αvalue␈α
of␈αthe␈α
atom␈α␈↓αerrset␈↓␈α
is␈αthe␈α
service␈αfunction␈α
for␈αthe␈αuser␈α
interrupt
␈↓ α_␈↓␈↓ αhwhich␈α∞is␈α∞signalled␈α∞when␈α∞an␈α∞error␈α∂is␈α∞caught␈α∞by␈α∞an␈α∞␈↓αerrset␈↓.␈α∞ The␈α∂argument␈α∞is
␈↓ α_␈↓␈↓ αh␈↓αnil␈↓␈α⊃and␈α⊃the␈α⊃returned␈α⊃value␈α⊃is␈α⊂ignored.␈α⊃ This␈α⊃user␈α⊃interrupt␈α⊃is␈α⊃initially␈α⊂o≥.
␈↓ α_␈↓␈↓ αhTurning it on a≥ects the behavior of the error system (see part 3.4).
␈↓ α_␈↓␈↓αfail-act␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈αvalue␈αof␈α␈↓αfail-act␈↓␈αis␈αthe␈α
service␈αfunction␈αfor␈αthe␈αuser␈αinterrupt␈α
which
␈↓ α_␈↓␈↓ αhis␈α∩signalled␈α∩when␈α∩any␈α∩of␈α∩a␈α∩large␈α∩variety␈α∩of␈α∩miscellaneous␈α∪error␈α∩conditions
␈↓ α_␈↓␈↓ αhoccurs.␈α The␈αargument␈αis␈αa␈αlist␈αwhose␈αcar␈αis␈αgenerally␈αa␈αsymbol␈αwhich␈αdescribes
␈↓ α_␈↓␈↓ αhthe␈αtype␈αof␈α
error␈αcondition.␈α The␈α
rest␈αof␈αthe␈α
list␈αis␈αvarious␈α
objects␈αrelated␈αto␈α
the
␈↓ α_␈↓␈↓ αherror.␈α↔ The␈α↔returned␈α↔value␈α↔depends␈α↔on␈α↔the␈α↔error.␈α↔ These␈α↔are␈α_not␈α↔very
␈↓ α_␈↓␈↓ αhstandardized␈αand␈αwill␈αnot␈αbe␈αdescribed␈αhere.␈α This␈αinterrupt␈αis␈αinitially␈αset␈αto␈αa
␈↓ α_␈↓␈↓ αhbreak loop.
␈↓ α_␈↓␈↓αgc-daemon␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α⊃value␈α∩of␈α⊃␈↓αgc-daemon␈↓␈α∩is␈α⊃the␈α∩service␈α⊃function␈α∩for␈α⊃the␈α∩user␈α⊃interrupt
␈↓ α_␈↓␈↓ αhwhich␈α⊂is␈α⊂signalled␈α⊂after␈α⊂each␈α⊂garbage␈α⊂collection.␈α⊂ The␈α⊂argument␈α⊂is␈α⊂a␈α⊃list␈α⊂of
␈↓ α_␈↓␈↓ αhitems;␈α⊗each␈α∃item␈α⊗is␈α∃of␈α⊗the␈α∃form␈α⊗␈↓α(␈↓↓space-name␈α∃free-before␈α⊗free-after␈↓α)␈↓.␈α∃ The
␈↓ α_␈↓␈↓ αhreturned value is ignored. This interrupt is initially turned o≥.
␈↓ α_␈↓␈↓αgc-lossage␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α⊂value␈α⊂of␈α⊂␈↓αgc-lossage␈↓␈α⊂is␈α⊂the␈α⊂service␈α⊂function␈α⊂for␈α⊂the␈α⊂user␈α⊂interrupt
␈↓ α_␈↓␈↓ αhwhich␈α≠is␈α≠signalled␈α≠when␈α≠there␈α≠is␈α≠no␈α≠more␈α≠memory.␈α≠ In␈α≠the␈α≠Multics
␈↓ α_␈↓␈↓ αhimplementation,␈α∂there␈α∂is␈α∂always␈α∂enough␈α∂memory,␈α∂so␈α∂this␈α∂user␈α∂interrupt␈α∞never
␈↓ α_␈↓␈↓ αhoccurs.␈α∞ In␈α∞the␈α∞pdp-10␈α∞implementation␈α∞the␈α
argument␈α∞is␈α∞the␈α∞name␈α∞of␈α∞the␈α
space
␈↓ α_␈↓␈↓ αhthat␈αlost,␈αand␈αthe␈αreturned␈αvalue␈α
is␈αignored.␈α This␈αinterrupt␈αis␈αinitially␈αset␈α
to␈αa
␈↓ α_␈↓␈↓ αhbreak loop.
␈↓ α_␈↓␈↓αgc-over∨ow␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α∞value␈α∂of␈α∞the␈α∞atom␈α∂␈↓αgc-over∨ow␈↓␈α∞is␈α∞the␈α∂service␈α∞function␈α∞for␈α∂the␈α∞user
␈↓ α_␈↓␈↓ αhinterrupt␈α
which␈αis␈α
signalled␈α
when␈αa␈α
space␈α
over∨ows␈αits␈α
␈↓↓gcmax␈↓.␈α
The␈αargument
␈↓ α_␈↓␈↓ αhis␈α∂the␈α∂name␈α∂of␈α∂the␈α∂space.␈α∂ The␈α∂returned␈α∂value␈α∂is␈α∂ignored.␈α∂ This␈α∂interrupt␈α∞is
␈↓ α_␈↓␈↓ αhinitiallly set to a break loop.
␈↓ α_␈↓Page 3-16␈↓ ε∃␈↓∧∪3-1.4.3␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αio-lossage␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α⊂value␈α⊂of␈α∂the␈α⊂atom␈α⊂␈↓αio-lossage␈↓␈α∂is␈α⊂the␈α⊂service␈α∂function␈α⊂for␈α⊂the␈α∂user
␈↓ α_␈↓␈↓ αhinterrupt␈α∩which␈α∩is␈α∩signalled␈α∩when␈α∩the␈α∩I/O␈α∩system␈α∩encounters␈α∩an␈α∩error,␈α⊃for
␈↓ α_␈↓␈↓ αhexample,␈αa␈α≡le␈αwhich␈αwas␈αbeing␈αopened␈αwas␈αnot␈αfound.␈α The␈αargument␈αis␈αa␈αlist
␈↓ α_␈↓␈↓ αhof␈α
the␈α
name␈α
of␈α
the␈α
function␈α
which␈α
erred␈α
and␈α
its␈α
arguments,␈α
which␈α
may␈α
have
␈↓ α_␈↓␈↓ αhbeen␈αstandardized␈αor␈αotherwise␈αpartially␈αdigested.␈α The␈αreturned␈αvalue␈αis␈α
a␈αlist
␈↓ α_␈↓␈↓ αhof␈αa␈αnew␈αform␈αto␈αbe␈αevaluated␈αin␈αplace␈αof␈αthe␈αcall␈αto␈αthe␈αfunction␈αwhich␈αerred.
␈↓ α_␈↓␈↓ αhThis interrupt is initially set to a break loop.
␈↓ α_␈↓␈↓αpdl-over∨ow␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α
value␈α
of␈α
the␈α
atom␈α
␈↓αpdl-over∨ow␈↓␈α
is␈α
the␈α
service␈α
function␈α
for␈α
the␈α
user
␈↓ α_␈↓␈↓ αhinterrupt␈α⊂which␈α∂is␈α⊂signalled␈α⊂when␈α∂a␈α⊂pushdown␈α⊂list␈α∂exceeds␈α⊂its␈α⊂␈↓↓pdlmax␈↓.␈α∂ The
␈↓ α_␈↓␈↓ αhargument␈α∪is␈α∪the␈α∀spacename␈α∪of␈α∪the␈α∪pushdown␈α∀list.␈α∪ The␈α∪returned␈α∀value␈α∪is
␈↓ α_␈↓␈↓ αhignored. This interrupt is initially set to a break loop.
␈↓ α_␈↓␈↓αunbnd-vrbl␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α⊂value␈α⊂of␈α⊂␈↓αunbnd-vrbl␈↓␈α⊂is␈α⊂the␈α⊂service␈α⊂function␈α⊂for␈α⊂the␈α⊂user␈α⊂interrupt
␈↓ α_␈↓␈↓ αhwhich␈α⊃is␈α⊃signalled␈α⊃when␈α⊃an␈α∩attempt␈α⊃is␈α⊃made␈α⊃to␈α⊃evaluate␈α⊃an␈α∩atomic␈α⊃symbol
␈↓ α_␈↓␈↓ αhwhich␈αdoes␈αnot␈αhave␈αa␈αvalue␈α(an␈αunbound␈αvariable.)␈αThe␈αargument␈αis␈αa␈αlist␈αof
␈↓ α_␈↓␈↓ αhthe␈α
symbol␈α
which␈α
could␈αnot␈α
be␈α
evaluated.␈α
The␈α
returned␈αvalue␈α
is␈α
a␈α
list␈α
of␈αa␈α
new
␈↓ α_␈↓␈↓ αhsymbol␈α∞to␈α∞be␈α∞evaluated␈α∞in␈α∞its␈α∂place.␈α∞ This␈α∞interrupt␈α∞is␈α∞initially␈α∞set␈α∞to␈α∂a␈α∞break
␈↓ α_␈↓␈↓ αhloop.
␈↓ α_␈↓␈↓αundf-fnctn␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α⊂value␈α⊂of␈α⊂␈↓αundf-fnctn␈↓␈α⊂is␈α⊂the␈α⊂service␈α⊂function␈α⊂for␈α⊂the␈α⊂user␈α⊂interrupt
␈↓ α_␈↓␈↓ αhwhich␈α∞is␈α∂signalled␈α∞when␈α∂an␈α∞attempt␈α∞is␈α∂made␈α∞to␈α∂apply␈α∞an␈α∂unde≡ned␈α∞function.
␈↓ α_␈↓␈↓ αhThe␈α
argument␈α
is␈α
a␈αlist␈α
of␈α
the␈α
functional␈α
form␈αwhich␈α
could␈α
not␈α
be␈αapplied.␈α
The
␈↓ α_␈↓␈↓ αhreturned␈α∩value␈α∩is␈α∩a␈α∩list␈α∩of␈α∩a␈α⊃new␈α∩functional␈α∩form␈α∩to␈α∩take␈α∩its␈α∩place.␈α⊃ This
␈↓ α_␈↓␈↓ αhinterrupt is initially set to a break loop.
␈↓ α_␈↓␈↓αunseen-go-tag␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈αvalue␈αof␈α␈↓αunseen-go-tag␈↓␈αis␈αthe␈αservice␈αfunction␈αfor␈αthe␈αuser␈αinterrupt
␈↓ α_␈↓␈↓ αhwhich␈αis␈α
signalled␈αwhen␈α␈↓αgo␈↓␈α
or␈α␈↓αthrow␈↓␈αis␈α
used␈αwith␈α
a␈αtag␈αwhich␈α
does␈αnot␈αexist␈α
in
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.4.3␈↓␈↓
↓Page 3-17
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αhthe␈αcurrent␈α␈↓αprog␈↓␈αbody␈αor␈αin␈αany␈α␈↓αcatch␈↓,␈αrespectively.␈α The␈αargument␈αis␈αa␈αlist␈αof
␈↓ α_␈↓␈↓ αhthe␈αerroneous␈α
tag.␈α The␈αreturned␈α
value␈αis␈αa␈α
list␈αof␈α
a␈αnew␈αtag␈α
to␈αreplace␈αit.␈α
This
␈↓ α_␈↓␈↓ αhinterrupt is initially set to a break loop.
␈↓ α_␈↓␈↓αwrng-no-args␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α
value␈α
of␈α
␈↓αwrng-no-args␈↓␈α
is␈α
the␈α
service␈α
function␈α
for␈α
the␈α∞user␈α
interrupt
␈↓ α_␈↓␈↓ αhwhich␈α∀is␈α∀signalled␈α∪when␈α∀a␈α∀function␈α∪is␈α∀called␈α∀with␈α∪the␈α∀wrong␈α∀number␈α∪of
␈↓ α_␈↓␈↓ αharguments.␈α
The␈α
argument␈α
is␈αa␈α
list␈α
of␈α
two␈α
items:␈αFirst,␈α
a␈α
list␈α
of␈α
the␈αfunction␈α
and
␈↓ α_␈↓␈↓ αhthe␈α∞arguments␈α∂that␈α∞were␈α∞passed.␈α∂ Second,␈α∞the␈α∞␈↓αlambda␈↓-list␈α∂if␈α∞the␈α∂function␈α∞was
␈↓ α_␈↓␈↓ αhinterpreted␈α∀or␈α∀the␈α∀same␈α∪dotted␈α∀pair␈α∀as␈α∀␈↓αargs␈↓␈α∪returns␈α∀if␈α∀the␈α∀function␈α∪was
␈↓ α_␈↓␈↓ αhcompiled.␈α The␈αreturned␈αvalue␈αis␈αa␈αlist␈αof␈αa␈αnew␈αform␈αto␈αbe␈αevaluated␈αin␈αplace
␈↓ α_␈↓␈↓ αhof the losing one. This interrupt is initially set to a break loop.
␈↓ α_␈↓␈↓αwrng-type-arg␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈αvalue␈αof␈α␈↓αwrng-type-arg␈↓␈αis␈αthe␈αservice␈αfunction␈αfor␈αthe␈αuser␈αinterrupt
␈↓ α_␈↓␈↓ αhwhich␈α
is␈α
signalled␈α
when␈α∞an␈α
argument␈α
is␈α
passed␈α∞to␈α
a␈α
system␈α
function␈α∞which␈α
is
␈↓ α_␈↓␈↓ αhnot␈αacceptable␈αto␈αthat␈αfunction.␈α The␈αargument␈αis␈αa␈αlist␈αof␈αthe␈αargument␈αwhich
␈↓ α_␈↓␈↓ αhwas␈αnot␈αaccepted.␈α The␈αreturned␈αvalue␈αis␈αa␈αlist␈αof␈αa␈αnew␈αargument␈αto␈αreplace␈αit.
␈↓ α_␈↓␈↓ αhThis␈α∞is␈α∞an␈α∞already-evaluated␈α∞argument,␈α∞␈↓↓not␈↓␈α
a␈α∞form␈α∞to␈α∞be␈α∞evaluated␈α∞to␈α∞get␈α
an
␈↓ α_␈↓␈↓ αhargument. This interrupt is initially set to a break loop.
␈↓ α_␈↓␈↓α*rset-trap␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_The␈α⊂value␈α⊂of␈α⊂␈↓α*rset-trap␈↓␈α⊂is␈α⊂the␈α⊂service␈α⊂function␈α⊂for␈α⊂the␈α⊂user␈α⊂interrupt
␈↓ α_␈↓␈↓ αhwhich␈α∞is␈α∞signalled␈α∞when␈α∞an␈α∞error␈α∞returns␈α∞control␈α∞to␈α∞top␈α∞level,␈α∞just␈α∂before␈α∞the
␈↓ α_␈↓␈↓ αhbindings␈αare␈α
restored.␈α By␈αconvention,␈α
the␈αhandler␈αfor␈α
this␈αinterrupt␈αshould␈α
not
␈↓ α_␈↓␈↓ αhdo␈αanything␈αunless␈α
the␈αvariable␈α␈↓α*rset␈↓␈αis␈α
non-␈↓αnil␈↓.␈α This␈αis␈α
so␈αthat␈αthe␈αuser␈α
will
␈↓ α_␈↓␈↓ αhnot␈α
be␈α
bothered␈α
unless␈α
he␈α
has␈α
put␈α
lisp␈α
in␈α
debugging␈α
mode.␈α
The␈α
argument␈α
is
␈↓ α_␈↓␈↓ αh␈↓αnil␈↓␈α⊃and␈α⊃the␈α⊃returned␈α⊃value␈α⊃is␈α⊃ignored.␈α⊃ This␈α⊃interrupt␈α⊃is␈α⊃initially␈α⊃set␈α∩to␈α⊃a
␈↓ α_␈↓␈↓ αhfunction which enters a break loop if ␈↓α*rset␈↓ is non-␈↓αnil␈↓.
␈↓ α_␈↓␈↓β1.4.4 Autoload␈↓
␈↓ α_␈↓␈↓ αHThe␈α∪␈↓↓autoload␈↓␈α∪feature␈α∩provides␈α∪the␈α∪ability␈α∩for␈α∪a␈α∪function␈α∩not␈α∪present␈α∪in␈α∩the
␈↓ α_␈↓environment␈α
to␈αbe␈α
automatically␈αloaded␈α
in␈αfrom␈α
a␈α≡le␈α
the␈α≡rst␈α
time␈αit␈α
is␈αcalled.␈α
When
␈↓ α_␈↓Page 3-18␈↓ ε∃␈↓∧∪3-1.4.3␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αeval,␈α∞apply,␈α∞funcall,␈↓␈α
or␈α∞the␈α∞version␈α
of␈α∞␈↓αapply␈↓␈α∞used␈α
by␈α∞compiled␈α∞LISP␈α∞code␈α
the
␈↓ α_␈↓≡rst␈αtime␈αa␈αfunction␈αis␈αreferenced␈αsearches␈αthe␈αproperty␈αlist␈αof␈αan␈αatom␈αlooking␈αfor␈αa
␈↓ α_␈↓functional␈α⊃property,␈α∩if␈α⊃the␈α∩≡rst␈α⊃functional␈α∩property␈α⊃found␈α∩is␈α⊃under␈α∩the␈α⊃indicator
␈↓ α_␈↓␈↓αautoload␈↓, automatic loading will occur.
␈↓ α_␈↓␈↓ αHAutomatic␈α∞loading␈α∞is␈α
performed␈α∞by␈α∞means␈α∞of␈α
the␈α∞␈↓αautoload␈↓␈α∞user␈α∞interrupt;␈α
thus
␈↓ α_␈↓the␈α⊃user␈α∩may␈α⊃assert␈α∩any␈α⊃desired␈α∩degree␈α⊃of␈α∩control␈α⊃over␈α∩it.␈α⊃ When␈α∩the␈α⊃␈↓αautoload␈↓
␈↓ α_␈↓property␈α
is␈α
encountered,␈α
the␈α
user␈α
interrupt␈α
handler␈α
is␈α
called␈α
with␈α
one␈α
argument,␈α
which
␈↓ α_␈↓is␈α∀a␈α∀dotted␈α∀pair␈α∃whose␈α∀car␈α∀is␈α∀the␈α∀atomic␈α∃symbol␈α∀which␈α∀is␈α∀the␈α∃function␈α∀being
␈↓ α_␈↓␈↓αautoload␈↓'ed,␈α∂and␈α⊂whose␈α∂cdr␈α⊂is␈α∂the␈α∂value␈α⊂of␈α∂the␈α⊂␈↓αautoload␈↓␈α∂property.␈α⊂ The␈α∂system-
␈↓ α_␈↓supplied handler for this user interrupt could have been de≡ned by:
␈↓ α_␈↓α␈↓ αx(setq autoload
␈↓ α_␈↓α␈↓ αx (function (lambda (x) (load (cdr x)) )))
␈↓ α_␈↓From␈αthis␈α
one␈αcan␈α
see␈αthat␈α
the␈αvalue␈α
of␈αthe␈α
␈↓αautoload␈↓␈αproperty␈α
should␈αbe␈α
the␈αname
␈↓ α_␈↓of␈α∪the␈α∪≡le␈α∪which␈α∀contains␈α∪the␈α∪de≡nition␈α∪of␈α∀the␈α∪function.␈α∪ Note:␈α∪ in␈α∀the␈α∪pdp-10
␈↓ α_␈↓implementations␈α∩the␈α∩system␈α∩autoload␈α∩handler␈α∩presently␈α∩uses␈α∩␈↓αfasload␈↓␈α∩rather␈α⊃than
␈↓ α_␈↓␈↓αload␈↓␈αbecause␈αthe␈α␈↓αload␈↓␈αfunction␈αrequires␈αthe␈α␈↓↓newio␈↓␈αfeature.␈α This␈αa≥ects␈αthe␈αform␈αof
␈↓ α_␈↓an ␈↓αautoload␈↓ property.
␈↓ α_␈↓␈↓ αHWhen␈αthe␈αinterrupt␈αhandler␈αreturns,␈αit␈αhad␈αbetter␈αhave␈αput␈αa␈αfunctional␈αproperty
␈↓ α_␈↓on␈α
the␈α
property␈α
list␈α
of␈α
the␈α
function␈α
being␈α
autoloaded.␈α
If␈α
not,␈α
an␈α
␈↓αundf-fnctn␈↓␈α
error
␈↓ α_␈↓will␈αoccur␈αwith␈αa␈αmessage␈αsuch␈α
as␈α"function␈αunde≡ned␈αafter␈αautoload."␈αNote␈α
that␈αthe
␈↓ α_␈↓functional␈α
property␈α
must␈α
be␈α
placed␈αon␈α
the␈α
property␈α
list␈α
before␈α
the␈α␈↓αautoload␈↓␈α
property.
␈↓ α_␈↓This is normally the case if ␈↓αdefun␈↓, ␈↓αdefprop␈↓, or the compiler is used.
␈↓ α_␈↓␈↓ αHExamples of setting up functions to be autoloaded:
␈↓ α_␈↓␈↓ αHIn the Multics implementation:
␈↓ α_␈↓␈↓ αH␈↓α(putprop 'foo ">udd>AutoProg>Library>foo-function" 'autoload)␈↓
␈↓ α_␈↓␈↓ αHIn the ITS implementation:
␈↓ α_␈↓␈↓ αH␈↓α(putprop 'foo '(foo fasl dsk me) 'autoload)␈↓
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.4.4␈↓␈↓
Page 3-19
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.5 Debugging␈↓
␈↓ α_␈↓␈↓β1.5.1 Binding, Pdl Pointers, and the Evaluator␈↓
␈↓ α_␈↓␈↓ αHThe␈α⊂MACLISP␈α⊂evaluator␈α⊂is␈α⊂based␈α⊂on␈α∂a␈α⊂push␈α⊂down␈α⊂list␈α⊂(pdl),␈α⊂or␈α⊂stack,␈α∂which
␈↓ α_␈↓holds␈αbindings,␈αevaluation␈αframes,␈αand␈αsundry␈αinternal␈αdata.␈α Bindings␈αare␈αvalues␈αof
␈↓ α_␈↓atomic␈α
symbols␈α
which␈α
are␈αsaved␈α
when␈α
the␈α
symbols␈αare␈α
used␈α
as␈α
lambda␈αvariables,␈α
prog
␈↓ α_␈↓variables,␈α⊂or␈α⊃do␈α⊂variables.␈α⊃ Evaluation␈α⊂frames␈α⊂are␈α⊃constructed␈α⊂when␈α⊃a␈α⊂non-atomic
␈↓ α_␈↓form is evaluated or when ␈↓αapply␈↓ is used. They correspond to function calls.
␈↓ α_␈↓␈↓ αHAs␈αthe␈αevaluator␈αrecursively␈αevaluates␈αa␈αform,␈αinformation␈αis␈αpushed␈αonto␈αthe␈α
pdl
␈↓ α_␈↓and␈α∂later␈α∞popped␈α∂o≥.␈α∞ When␈α∂the␈α∂␈↓α*rset␈↓␈α∞and␈α∂␈↓αnouuo␈↓␈α∞∨ags␈α∂are␈α∞␈↓αt␈↓␈α∂this␈α∂information␈α∞is
␈↓ α_␈↓su~ciently␈α
detailed␈αto␈α
be␈αof␈α
use␈αin␈α
debugging.␈α (See␈α
the␈αvariables␈α
␈↓α*rset␈↓␈α
and␈α␈↓αnouuo␈↓
␈↓ α_␈↓in the next section.)
␈↓ α_␈↓␈↓ αHA␈αposition␈αwithin␈αthe␈αpdl␈αmay␈αbe␈αnamed␈αby␈αmeans␈αof␈αa␈α"pdl␈αpointer,"␈αwhich␈αis␈αa
␈↓ α_␈↓negative␈α≡xnum␈αwhose␈α
value␈αhas␈αmeaning␈αto␈α
the␈αevaluator.␈α ␈↓αnil␈↓␈α
is␈αalso␈αaccepted␈αas␈α
a
␈↓ α_␈↓pdl␈αpointer.␈α It␈αmeans␈αthe␈αtop␈αof␈αthe␈αstack,␈αi.e.␈αthe␈αmost␈αrecent␈αevaluation.␈α Note␈αthat
␈↓ α_␈↓this␈α
is␈α
di≥erent␈α
from␈α∞␈↓αnil␈↓␈α
as␈α
a␈α
binding␈α
context␈α∞pointer,␈α
which␈α
means␈α
the␈α∞bottom␈α
of
␈↓ α_␈↓the␈α
stack␈α
or␈α
the␈αoutermost␈α
evaluation.␈α
0␈α
is␈α
also␈αaccepted␈α
as␈α
a␈α
pdl␈α
pointer;␈αit␈α
designates
␈↓ α_␈↓the␈α∂frame␈α⊂at␈α∂the␈α∂bottom␈α⊂of␈α∂the␈α∂stack.␈α⊂ Pdl␈α∂pointers␈α∂may␈α⊂be␈α∂used␈α∂as␈α⊂arguments␈α∂to
␈↓ α_␈↓several␈αdebugging␈αfunctions␈αdescribed␈αin␈αthe␈αnext␈αsection.␈α Since␈αthe␈α≡xnum␈αvalue␈α
of
␈↓ α_␈↓a␈α
pdl␈αpointer␈α
has␈α
only␈αinternal␈α
meaning,␈αgenerally␈α
a␈α
pdl␈αpointer␈α
cannot␈α
be␈αobtained
␈↓ α_␈↓from␈αuser␈αinput,␈αexcept␈αby␈αthe␈αuser␈αtyping␈αin␈αa␈αpdl␈αpointer␈αchosen␈αfrom␈αa␈αlist␈αof␈αpdl
␈↓ α_␈↓pointers␈αtyped␈αout␈α
at␈αhim.␈α The␈α
"frame"␈αfunctions␈αdescribed␈α
in␈αthe␈αnext␈α
section␈αmay
␈↓ α_␈↓be used to obtain pdl pointers.
␈↓ α_␈↓␈↓ αHAn␈α
important␈α
thing␈α
to␈α
note␈α
about␈α∞pdl␈α
pointers␈α
is␈α
their␈α
limited␈α
scope␈α∞of␈α
validity.
␈↓ α_␈↓If␈αthe␈αinformation␈αon␈αthe␈αpdl␈αwhich␈αis␈αnamed␈αby␈αa␈αpdl␈αpointer␈αhas␈αbeen␈αpopped␈αo≥
␈↓ α_␈↓since the pdl pointer was created, the pdl pointer no longer has valid meaning.
␈↓ α_␈↓␈↓β1.5.2 Functions for Debugging␈↓
␈↓ α_␈↓␈↓α*rset␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_␈↓α(*rset␈α␈↓↓x␈↓α)␈↓␈αsets␈αthe␈α␈↓α*rset␈↓␈αswitch␈αto␈α␈↓αnil␈↓␈αif␈α␈↓↓x␈↓␈αis␈α␈↓αnil␈↓,␈αor␈αto␈α␈↓αt␈↓␈αif␈α␈↓↓x␈↓␈αis␈αnon-␈↓αnil␈↓,
␈↓ α_␈↓␈↓ αhand returns the value it set it to.
␈↓ α_␈↓Page 3-20␈↓ ε ␈↓∧∪3-1.5␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓α*rset␈↓ ∧XSWITCH␈↓
␈↓ α_␈↓␈↓ β_If␈α∂the␈α∂␈↓α*rset␈↓␈α⊂switch␈α∂is␈α∂␈↓αt␈↓,␈α⊂extra␈α∂information␈α∂is␈α⊂kept␈α∂by␈α∂the␈α⊂interpreter␈α∂to
␈↓ α_␈↓␈↓ αhallow␈αthe␈αdebugging␈αfunctions,␈αsuch␈αas␈α␈↓αbaktrace␈↓␈αand␈α␈↓αevalframe␈↓,␈αto␈αwork.␈α In
␈↓ α_␈↓␈↓ αhaddition,␈α
the␈α
interpreter␈αwill␈α
make␈α
extra␈α
checks␈αsuch␈α
as␈α
checking␈α
the␈αnumber␈α
of
␈↓ α_␈↓␈↓ αharguments␈α⊂passed␈α⊃to␈α⊂a␈α⊃subr␈α⊂or␈α⊂lsubr␈α⊃and␈α⊂checking␈α⊃that␈α⊂array␈α⊃subscripts␈α⊂lie
␈↓ α_␈↓␈↓ αhwithin␈α
the␈αdeclared␈α
bounds.␈α Generally,␈α
the␈α
␈↓α*rset␈↓␈αswitch␈α
being␈αon␈α
means␈α"I␈α
am
␈↓ α_␈↓␈↓ αhdebugging."
␈↓ α_␈↓␈↓αnouuo␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_␈↓α(nouuo t)␈↓ sets the nouuo switch.
␈↓ α_␈↓␈↓ β_␈↓α(nouuo nil)␈↓ turns o≥ the nouuo switch. (this is the initial state.)
␈↓ α_␈↓␈↓ β_␈↓αnouuo␈↓␈αreturns␈α␈↓αt␈↓␈αor␈α␈↓αnil␈↓␈αaccording␈α
to␈αwhether␈αit␈αturned␈αthe␈αnouuo␈αswitch␈α
on
␈↓ α_␈↓␈↓ αhor o≥.
␈↓ α_␈↓␈↓αnouuo␈↓ ∧XSWITCH␈↓
␈↓ α_␈↓␈↓ β_If␈α⊂the␈α⊂␈↓αnouuo␈↓␈α∂switch␈α⊂is␈α⊂on,␈α∂function␈α⊂calls␈α⊂made␈α∂by␈α⊂compiled␈α⊂functions␈α∂to
␈↓ α_␈↓␈↓ αhcompiled␈αfunctions␈αor␈α
system␈αfunctions␈αare␈αforced␈α
to␈αgo␈αthrough␈αthe␈α
interpreter
␈↓ α_␈↓␈↓ αheach␈α∞time.␈α∞ This␈α∞aids␈α∞in␈α∞debugging.␈α∞ If␈α∞the␈α∞␈↓αnouuo␈↓␈α∞switch␈α∞is␈α∞o≥,␈α∞which␈α∂is␈α∞the
␈↓ α_␈↓␈↓ αhnormal case, compiled calls can be made to go directly, which is much faster.
␈↓ α_␈↓␈↓ β_The␈α␈↓αnouuo␈↓␈αswitch␈α
may␈αbe␈αturned␈αo≥␈α
at␈αany␈αtime.␈α Each␈α
compiled␈αfunction
␈↓ α_␈↓␈↓ αhcall␈α∂will␈α∂only␈α∂go␈α∞through␈α∂the␈α∂interpreter␈α∂once␈α∂more,␈α∞at␈α∂which␈α∂time␈α∂it␈α∂will␈α∞be
␈↓ α_␈↓␈↓ αhchanged␈α∀to␈α∀go␈α∪directly.␈α∀ When␈α∀the␈α∀␈↓αnouuo␈↓␈α∪switch␈α∀is␈α∀turned␈α∀on,␈α∪␈↓α(sstatus
␈↓ α_␈↓α␈↓ αhuuolinks)␈↓␈α∪should␈α∩be␈α∪evaluated.␈α∪ This␈α∩ensures␈α∪that␈α∩all␈α∪direct␈α∪linkages␈α∩are
␈↓ α_␈↓␈↓ αhturned o≥.
␈↓ α_␈↓␈↓ β_The␈αtrace␈αpackage␈αturns␈αthis␈αswitch␈αon␈αwhen␈αa␈αfunction␈αis␈αtraced,␈αin␈αorder
␈↓ α_␈↓␈↓ αhto ensure that tracing will work even for compiled functions.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.2␈↓␈↓ ␈Page 3-21
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αbaktrace␈↓ ∧XLSUBR 0 to 2 args␈↓
␈↓ α_␈↓␈↓ β_␈↓αbaktrace␈↓␈α⊂displays␈α∂the␈α⊂stack␈α∂of␈α⊂pending␈α∂function␈α⊂calls.␈α∂ It␈α⊂only␈α⊂works␈α∂in
␈↓ α_␈↓␈↓ αh␈↓α(*rset␈αt)␈↓␈αmode.␈α
The␈α≡rst␈αargument␈α
is␈αa␈αpdl␈α
pointer,␈αas␈αwith␈α
␈↓αevalframe␈↓.␈α If
␈↓ α_␈↓␈↓ αhit␈αis␈αomitted,␈α␈↓αnil␈↓␈αis␈αassumed,␈αwhich␈αmeans␈αstart␈αfrom␈αthe␈αtop␈αof␈αthe␈αpdl.␈α The
␈↓ α_␈↓␈↓ αhsecond␈αargument␈αis␈αthe␈αmaximum␈αnumber␈α
of␈αlines␈αto␈αbe␈αtyped;␈αif␈αit␈α
is␈αomitted
␈↓ α_␈↓␈↓ αhthe entire stack is displayed.
␈↓ α_␈↓␈↓αerrframe␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_␈↓αerrframe␈↓␈α⊃returns␈α⊂a␈α⊃list␈α⊃describing␈α⊂an␈α⊃error␈α⊃which␈α⊂has␈α⊃been␈α⊃stacked␈α⊂up
␈↓ α_␈↓␈↓ αhbecause␈α
of␈α
a␈α∞user␈α
interrupt.␈α
The␈α∞list␈α
has␈α
the␈α∞form␈α
␈↓α(err␈α
␈↓↓pdlptr␈α∞message␈α
bcp␈↓α)␈↓,
␈↓ α_␈↓␈↓ αhwhere␈α␈↓↓pdlptr␈↓␈αis␈αa␈α
number␈αwhich␈αdescribes␈αthe␈αlocation␈α
in␈αthe␈αpdl␈αof␈α
the␈αerror,
␈↓ α_␈↓␈↓ αh␈↓↓message␈↓␈α
is␈αa␈α
character␈αstring␈α
which␈αcan␈α
be␈αprinted␈α
out␈αas␈α
a␈αdescription␈α
of␈αthe
␈↓ α_␈↓␈↓ αherror,␈αand␈α␈↓↓bcp␈↓␈αis␈αa␈αnumber␈αwhich␈αcan␈α
be␈αused␈αas␈αa␈αsecond␈αargument␈αto␈α␈↓αeval␈↓␈α
or
␈↓ α_␈↓␈↓ αha␈αthird␈αargument␈αto␈α␈↓αapply␈↓␈αto␈αcause␈αevaluation␈αusing␈αthe␈αbindings␈αin␈αe≥ect␈αjust
␈↓ α_␈↓␈↓ αhbefore the error occurred.
␈↓ α_␈↓␈↓ β_The␈α
argument␈α∞to␈α
␈↓αerrframe␈↓␈α∞can␈α
be␈α∞␈↓αnil␈↓,␈α
which␈α∞means␈α
to␈α∞≡nd␈α
the␈α∞error␈α
at
␈↓ α_␈↓␈↓ αhthe␈α
top␈α
of␈αthe␈α
stack;␈α
i.e.␈α
the␈αmost␈α
recent␈α
error.␈α It␈α
can␈α
also␈α
be␈αa␈α
pdl␈α
ptr,␈αin␈α
which
␈↓ α_␈↓␈↓ αhcase␈α⊂the␈α∂stack␈α⊂is␈α∂searched␈α⊂downward␈α∂from␈α⊂the␈α∂indicated␈α⊂position.␈α⊂ Thus␈α∂the
␈↓ α_␈↓␈↓ αhsecond most recent error may be found by:
␈↓ α_␈↓␈↓ ∧H␈↓α(errframe (cadr (errframe nil)))␈↓
␈↓ α_␈↓␈↓ β_The␈α∞argument␈α∂to␈α∞␈↓αerrframe␈↓␈α∞may␈α∂also␈α∞be␈α∞a␈α∂positive␈α∞number,␈α∞which␈α∂is␈α∞the
␈↓ α_␈↓␈↓ αhnegative␈αof␈αa␈αpdl␈αptr.␈α This␈αmeans␈αstart␈αfrom␈αthe␈αposition␈αin␈αthe␈αstack␈αmarked
␈↓ α_␈↓␈↓ αhby the pdl ptr and search upwards.
␈↓ α_␈↓␈↓ β_If no error is found, ␈↓αerrframe␈↓ returns ␈↓αnil␈↓.
␈↓ α_␈↓␈↓αerrprint␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_␈↓αerrprint␈↓␈αtreats␈αits␈αargument␈αthe␈αsame␈αas␈α␈↓αerrframe␈↓.␈α The␈αmessage␈αportion
␈↓ α_␈↓␈↓ αhof␈α
the␈αerror␈α
frame␈αis␈α
␈↓αprinc␈↓'ed.␈α ␈↓αerrprint␈↓␈α
returns␈α
␈↓αt␈↓␈αif␈α
a␈αmessage␈α
was␈αtyped␈α
out
␈↓ α_␈↓␈↓ αhand ␈↓αnil␈↓ if no error frame was found.
␈↓ α_␈↓Page 3-22␈↓ ε∃␈↓∧∪3-1.5.2␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αevalframe␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_The␈α∞argument␈α∞to␈α∞␈↓αevalframe␈↓␈α∞is␈α∞a␈α∞pdl␈α∞ptr,␈α∞as␈α∞with␈α∞␈↓αerrframe␈↓.␈α∞ The␈α∂pdl␈α∞is
␈↓ α_␈↓␈↓ αhsearched␈α∩for␈α∩an␈α∩evaluation␈α∩of␈α∩a␈α⊃function␈α∩call,␈α∩using␈α∩the␈α∩same␈α∩rules␈α⊃about
␈↓ α_␈↓␈↓ αhstarting␈α∞point␈α∞and␈α∞direction␈α∂as␈α∞␈↓αerrframe␈↓␈α∞uses.␈α∞ ␈↓αevalframe␈↓␈α∞always␈α∂skips␈α∞over
␈↓ α_␈↓␈↓ αhany calls to itself that it ≡nds in the pdl.
␈↓ α_␈↓␈↓ β_The␈α∂value␈α∂is␈α∂a␈α∂list␈α∂␈↓α(␈↓↓type␈α∂pdlptr␈α∂form␈α∂bcp␈↓α)␈↓,␈α∂where␈α∂␈↓↓type␈↓␈α∂is␈α∂␈↓αeval␈↓␈α⊂or␈α∂␈↓αapply␈↓,
␈↓ α_␈↓␈↓ αh␈↓↓pdlptr␈↓␈α∂is␈α∂a␈α∞pdl␈α∂pointer␈α∂to␈α∂the␈α∞evaluation␈α∂in␈α∂the␈α∂stack,␈α∞suitable␈α∂for␈α∂use␈α∂as␈α∞an
␈↓ α_␈↓␈↓ αhargument␈α⊂to␈α⊃␈↓αevalframe␈↓␈α⊂or␈α⊂␈↓αerrframe␈↓␈α⊃or␈α⊂␈↓αbaktrace␈↓,␈α⊂␈↓↓form␈↓␈α⊃is␈α⊂the␈α⊃form␈α⊂being
␈↓ α_␈↓␈↓ αhevaluated␈α∀or␈α∃a␈α∀list␈α∃of␈α∀the␈α∃name␈α∀of␈α∃the␈α∀function␈α∃being␈α∀applied␈α∃and␈α∀the
␈↓ α_␈↓␈↓ αharguments␈αit␈αwas␈αapplied␈αto,␈αand␈α␈↓↓bcp␈↓␈αis␈αa␈αbinding␈αcontext␈αpointer␈αwhich␈αcan␈αbe
␈↓ α_␈↓␈↓ αhused␈α∞with␈α∞␈↓αeval␈↓␈α∞to␈α∞evaluate␈α∞something␈α∞in␈α∞the␈α∞binding␈α∞context␈α∞just␈α∞before␈α
the
␈↓ α_␈↓␈↓ αhevaluation found by ␈↓αevalframe␈↓.
␈↓ α_␈↓␈↓ β_␈↓αevalframe␈↓ returns ␈↓αnil␈↓ if no evaluation can be found.
␈↓ α_␈↓␈↓ β_␈↓αevalframe␈↓ only works in ␈↓α(*rset t)␈↓ mode.
␈↓ α_␈↓␈↓αfreturn␈↓ ∧XSUBR 2 args␈↓
␈↓ α_␈↓␈↓ β_␈↓α(freturn␈α∩␈↓↓p␈α∩x)␈↓␈α⊃returns␈α∩control␈α∩to␈α∩the␈α⊃evaluation␈α∩designated␈α∩by␈α∩the␈α⊃pdl
␈↓ α_␈↓␈↓ αhpointer␈α␈↓↓p␈↓,␈αand␈αforces␈αit␈αto␈αreturn␈α␈↓↓x␈↓.␈α This␈α"non-local-goto"␈αfunction␈αcan␈αbe␈αused
␈↓ α_␈↓␈↓ αhto do fancy recovery from errors.
␈↓ α_␈↓The following functions only exist in the Multics implementation.
␈↓ α_␈↓␈↓αbaktrace1␈↓ ∧XLSUBR 0 to 2 args␈↓
␈↓ α_␈↓␈↓ β_␈↓αbaktrace1␈↓␈α∞is␈α∞the␈α∞same␈α∂as␈α∞␈↓αbaktrace␈↓␈α∞except␈α∞that␈α∞binding␈α∂context␈α∞pointers
␈↓ α_␈↓␈↓ αhsuitable␈α∞for␈α∂use␈α∞with␈α∞␈↓αeval␈↓␈α∂and␈α∞␈↓αapply␈↓␈α∞are␈α∂displayed␈α∞along␈α∞with␈α∂the␈α∞function
␈↓ α_␈↓␈↓ αhnames.
␈↓ α_␈↓␈↓αbaktrace2␈↓ ∧XLSUBR 0 to 2 args␈↓
␈↓ α_␈↓␈↓ β_␈↓αbaktrace2␈↓␈αis␈αthe␈αsame␈αas␈α␈↓αbaktrace1␈↓␈αexcept␈αthat␈αpdl␈αpointers,␈α
suitable␈αfor
␈↓ α_␈↓␈↓ αhuse␈α∩with␈α∩␈↓αbaktrace␈↓␈α⊃and␈α∩␈↓αevalframe␈↓,␈α∩are␈α⊃displayed␈α∩along␈α∩with␈α∩the␈α⊃function
␈↓ α_␈↓␈↓ αhnames and binding context pointers.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.2␈↓␈↓ {Page 3-23
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αevalhook␈↓ ∧XVARIABLE␈↓
␈↓ α_␈↓␈↓ β_If␈α∂the␈α∂value␈α∂of␈α∂␈↓αevalhook␈↓␈α⊂is␈α∂non-null,␈α∂then␈α∂special␈α∂things␈α∂happen␈α⊂in␈α∂the
␈↓ α_␈↓␈↓ αhevaluator.␈α When␈α
a␈αform␈α
(even␈αan␈α
atom)␈αis␈α
to␈αbe␈α
evaluated,␈α␈↓αevalhook␈↓␈αis␈α
bound
␈↓ α_␈↓␈↓ αhto␈α␈↓αnil␈↓␈αand␈αthe␈α
functional␈αform␈αwhich␈αwas␈αits␈α
value␈αis␈αapplied␈αto␈αone␈α
argument
␈↓ α_␈↓␈↓ αh-␈α∩the␈α⊃form␈α∩that␈α∩was␈α⊃trying␈α∩to␈α∩be␈α⊃evaluated.␈α∩ The␈α∩value␈α⊃it␈α∩returns␈α∩is␈α⊃then
␈↓ α_␈↓␈↓ αhreturned␈α⊃from␈α⊃the␈α⊃evaluator.␈α⊃ This␈α⊂feature␈α⊃is␈α⊃used␈α⊃by␈α⊃the␈α⊃Stepper␈α⊂package
␈↓ α_␈↓␈↓ αhdescribed later in this section.
␈↓ α_␈↓␈↓ β_␈↓αevalhook␈↓␈αis␈αbound␈αto␈α␈↓αnil␈↓␈αby␈α␈↓αbreak␈↓,␈αand␈α␈↓αsetq␈↓'ed␈αto␈α␈↓αnil␈↓␈αby␈αerrors␈αthat␈αgo
␈↓ α_␈↓␈↓ αhback␈α∞to␈α∂top␈α∞level␈α∂and␈α∞print␈α∂␈↓α*␈↓.␈α∞ This␈α∞provides␈α∂the␈α∞ability␈α∂to␈α∞escape␈α∂from␈α∞this
␈↓ α_␈↓␈↓ αhmode if something bad happens.
␈↓ α_␈↓␈↓ β_In␈α∀order␈α∀not␈α∀to␈α∀impair␈α∃the␈α∀e~ciency␈α∀of␈α∀the␈α∀LISP␈α∃interpreter,␈α∀several
␈↓ α_␈↓␈↓ αhrestrictions␈α
are␈α
imposed␈α
on␈α
␈↓αevalhook␈↓.␈α
It␈α
only␈α
applies␈α
to␈α
evaluation␈α
-␈αwhether
␈↓ α_␈↓␈↓ αhin␈α∂a␈α∞read-eval-print␈α∂loop,␈α∂internally␈α∞in␈α∂evaluating␈α∂arguments␈α∞in␈α∂forms,␈α∂or␈α∞by
␈↓ α_␈↓␈↓ αhexplicit␈α⊃use␈α⊂of␈α⊃the␈α⊂function␈α⊃␈↓αeval␈↓.␈α⊂ It␈α⊃␈↓↓does␈α⊂not␈↓␈α⊃have␈α⊂any␈α⊃e≥ect␈α⊃on␈α⊂compiled
␈↓ α_␈↓␈↓ αhfunction␈α∀references,␈α∃on␈α∀use␈α∀of␈α∃the␈α∀function␈α∀␈↓αapply␈↓,␈α∃or␈α∀on␈α∃the␈α∀"mapping"
␈↓ α_␈↓␈↓ αhfunctions.␈α∞ Normally␈α∞the␈α∂evaluator␈α∞does␈α∞not␈α∞check␈α∂the␈α∞value␈α∞of␈α∂␈↓αevalhook␈↓,␈α∞in
␈↓ α_␈↓␈↓ αhorder␈α⊃to␈α⊃save␈α∩time.␈α⊃ To␈α⊃make␈α⊃it␈α∩check,␈α⊃you␈α⊃must␈α⊃both␈α∩be␈α⊃in␈α⊃␈↓α(*rset␈α∩t)␈↓␈α⊃-
␈↓ α_␈↓␈↓ αhdebugging␈α~-␈α~mode,␈α~and␈α~have␈α~done␈α~␈↓α(sstatus␈α~evalhook␈α~t)␈↓.␈α~ Not␈α~all
␈↓ α_␈↓␈↓ αhimplementations␈αneed␈αboth␈αof␈αthose,␈αbut␈αyou␈αshould␈αalways␈αdo␈αboth␈αto␈αbe␈αsure.
␈↓ α_␈↓␈↓ αhIf you use the Stepper package, you need not worry; it does this automatically.
␈↓ α_␈↓␈↓αevalhook␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_␈↓α(evalhook␈α∩␈↓↓form␈α⊃hook␈↓α)␈↓␈α∩is␈α∩a␈α⊃function␈α∩which␈α⊃helps␈α∩exploit␈α∩the␈α⊃␈↓αevalhook␈↓
␈↓ α_␈↓␈↓ αhfeature.␈α The␈α␈↓↓form␈↓␈α
is␈αevaluated␈αwith␈α
␈↓αevalhook␈αlambda␈↓-bound␈αto␈αthe␈α
functional
␈↓ α_␈↓␈↓ αhform␈α
␈↓αhook␈↓.␈α
The␈αchecking␈α
of␈α
␈↓αevalhook␈↓␈αis␈α
bypassed␈α
in␈αthe␈α
evaluation␈α
of␈α␈↓↓form␈↓
␈↓ α_␈↓␈↓ αhitself,␈α
but␈α∞not␈α
in␈α
any␈α∞subsidiary␈α
evaluations,␈α
for␈α∞instance␈α
of␈α
arguments␈α∞in␈α
the
␈↓ α_␈↓␈↓ αh␈↓↓form␈↓. This is like a "one-instruction proceed" in a machine-language debugger.
␈↓ α_␈↓Page 3-24␈↓ ε∃␈↓∧∪3-1.5.2␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.5.3 The Trace Package␈↓
␈↓ α_␈↓␈↓ αHThe␈α∂LISP␈α∞trace␈α∂package␈α∞provides␈α∂the␈α∂ability␈α∞to␈α∂perform␈α∞various␈α∂actions␈α∂at␈α∞the
␈↓ α_␈↓time␈αa␈αfunction␈αis␈αcalled␈αand␈αat␈αthe␈αtime␈αit␈αreturns.␈α This␈αcan␈αbe␈αused␈αfor␈αtraditional
␈↓ α_␈↓tracing or for more sophisticated debugging actions.
␈↓ α_␈↓␈↓ αHThe␈α↔trace␈α↔package␈α↔is␈α⊗not␈α↔part␈α↔of␈α↔the␈α⊗initial␈α↔environment;␈α↔however,␈α↔it␈α⊗is
␈↓ α_␈↓automatically loaded in on the ≡rst reference to the function ␈↓αtrace␈↓.
␈↓ α_␈↓␈↓ αHThe␈α⊂lisp␈α⊂trace␈α⊂package␈α⊂consists␈α⊂of␈α⊂three␈α⊂main␈α⊂functions,␈α⊂␈↓αtrace␈↓,␈α⊂␈↓αuntrace␈↓,␈α⊂and
␈↓ α_␈↓␈↓αremtrace␈↓, all of which are fexprs.
␈↓ α_␈↓␈↓ αHA call to ␈↓αtrace␈↓ has the following form:
␈↓ α_␈↓␈↓ ¬F␈↓α(trace ␈↓↓trace specs␈↓α)␈↓
␈↓ α_␈↓A ␈↓↓trace spec␈↓ in turn is either an atom (the name of the function to be traced) or a list:
␈↓ α_␈↓␈↓ ∧m␈↓α(␈↓↓function-name option1 option2 ...␈↓α)␈↓
␈↓ α_␈↓where the options are as follows:
␈↓ α_␈↓␈↓αbreak␈↓↓ pred␈↓␈↓ ∧_causes␈α∞a␈α∞break␈α
after␈α∞printing␈α∞the␈α∞entry␈α
trace␈α∞(if␈α∞any)␈α∞but␈α
before
␈↓ α_␈↓␈↓ ∧_applying␈αthe␈αtraced␈αfunction␈αto␈αits␈αarguments,␈αif␈αand␈αonly␈αif␈α␈↓↓pred␈↓
␈↓ α_␈↓␈↓ ∧_evaluates to non-␈↓αnil␈↓.
␈↓ α_␈↓␈↓αcond␈↓↓ pred␈↓␈↓ ∧_causes␈α
trace␈α∞information␈α
to␈α∞be␈α
printed␈α∞for␈α
function␈α∞entry␈α
and/or
␈↓ α_␈↓␈↓ ∧_exit if and only if ␈↓↓pred␈↓ evaluates to non-␈↓αnil␈↓.
␈↓ α_␈↓␈↓αwherein␈↓↓ fn␈↓␈↓ ∧_causes␈α∀the␈α∃function␈α∀to␈α∃be␈α∀traced␈α∀only␈α∃when␈α∀called␈α∃from␈α∀the
␈↓ α_␈↓␈↓ ∧_speci≡ed␈αfunction␈α␈↓↓fn␈↓.␈α
One␈αcan␈αgive␈α
several␈αtrace␈αspecs␈α
to␈α␈↓αtrace␈↓,
␈↓ α_␈↓␈↓ ∧_all␈α∃specifying␈α∃the␈α⊗same␈α∃function␈α∃but␈α∃with␈α⊗di≥erent␈α∃␈↓αwherein␈↓
␈↓ α_␈↓␈↓ ∧_options,␈α∩so␈α∩that␈α⊃the␈α∩function␈α∩is␈α⊃traced␈α∩in␈α∩di≥erent␈α∩ways␈α⊃when
␈↓ α_␈↓␈↓ ∧_called␈α
from␈α∞di≥erent␈α
functions.␈α∞ Note␈α
that␈α
if␈α∞␈↓↓fn␈↓␈α
is␈α∞already␈α
being
␈↓ α_␈↓␈↓ ∧_traced␈α∃itself,␈α∃the␈α∃␈↓αwherein␈↓␈α⊗option␈α∃probably␈α∃will␈α∃not␈α⊗work␈α∃as
␈↓ α_␈↓␈↓ ∧_desired, probably. (Then again, it might.)
␈↓ α_␈↓␈↓αargpdl␈↓↓ pdl␈↓␈↓ ∧_speci≡es␈α
an␈α
atom␈α∞␈↓↓pdl␈↓␈α
whose␈α
value␈α
␈↓αtrace␈↓␈α∞initially␈α
sets␈α
to␈α∞␈↓αnil␈↓.␈α
A
␈↓ α_␈↓␈↓ ∧_list␈α
of␈α
the␈α
current␈α
recursion␈α
level␈α
for␈α
the␈α
function,␈α
the␈αfunction's
␈↓ α_␈↓␈↓ ∧_name,␈α
and␈α∞a␈α
list␈α
of␈α∞the␈α
arguments␈α
is␈α∞␈↓αcons␈↓'ed␈α
onto␈α
the␈α∞␈↓↓pdl␈↓␈α
when
␈↓ α_␈↓␈↓ ∧_the␈αfunction␈αis␈αentered,␈αand␈α␈↓αcdr␈↓'ed␈αback␈αo≥␈αwhen␈αthe␈αfunction␈αis
␈↓ α_␈↓␈↓ ∧_exited.␈α The␈α
␈↓↓pdl␈↓␈αcan␈α
be␈αinspected␈α
from␈αa␈α
breakpoint,␈αfor␈α
example,
␈↓ α_␈↓␈↓ ∧_and␈α⊂used␈α⊂to␈α⊃determine␈α⊂the␈α⊂very␈α⊃recent␈α⊂history␈α⊂of␈α⊃the␈α⊂function.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.3␈↓␈↓ {Page 3-25
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ ∧_This␈α⊂option␈α⊂can␈α⊂be␈α⊃used␈α⊂with␈α⊂or␈α⊂without␈α⊂printed␈α⊃trace␈α⊂output.
␈↓ α_␈↓␈↓ ∧_Each␈α
function␈α
can␈α
be␈α
given␈α
its␈αown␈α
f2pdl,␈α
or␈α
one␈α
␈↓↓pdl␈↓␈α
may␈αserve
␈↓ α_␈↓␈↓ ∧_several functions.
␈↓ α_␈↓␈↓αentry␈↓↓ list␈↓␈↓ ∧_speci≡es␈α∞a␈α∞list␈α∞of␈α∞arbitrary␈α∞S-expressions␈α∞whose␈α∞values␈α∞are␈α∂to␈α∞be
␈↓ α_␈↓␈↓ ∧_printed␈α⊃along␈α⊃with␈α⊃the␈α⊃usual␈α⊃entry-trace.␈α⊃ The␈α⊃list␈α⊃of␈α⊂resultant
␈↓ α_␈↓␈↓ ∧_values,␈αwhen␈αprinted,␈αis␈αpreceded␈αby␈αa␈α␈↓α||␈↓␈αto␈αseparate␈αit␈α
from␈αthe
␈↓ α_␈↓␈↓ ∧_other information.
␈↓ α_␈↓␈↓αexit␈↓↓ list␈↓␈↓ ∧_similar␈α⊗to␈α⊗␈↓αentry␈↓,␈α⊗but␈α⊗speci≡es␈α⊗expressions␈α⊗whose␈α⊗values␈α⊗are
␈↓ α_␈↓␈↓ ∧_printed␈α∂with␈α∂the␈α⊂exit-trace.␈α∂ Again,␈α∂the␈α⊂list␈α∂of␈α∂values␈α⊂printed␈α∂is
␈↓ α_␈↓␈↓ ∧_preceded by ␈↓α||␈↓.
␈↓ α_␈↓␈↓αarg␈↓␈↓ α_␈↓␈↓ ∧_specify␈α⊃that␈α∩the␈α⊃function's␈α⊃arguments,␈α∩resultant␈α⊃value,␈α∩both,␈α⊃or
␈↓ α_␈↓␈↓αvalue␈↓␈↓ α_␈↓␈↓ ∧_neither␈αare␈α
to␈αbe␈α
traced.␈α If␈α
not␈αspeci≡ed,␈α
the␈αdefault␈α
is␈αboth.␈α
Any
␈↓ α_␈↓␈↓αboth␈↓␈↓ α_␈↓␈↓ ∧_"options"␈αfollowing␈αone␈αof␈αthese␈αfour␈αare␈αassumed␈αto␈αbe␈αarbitrary
␈↓ α_␈↓␈↓αnil␈↓␈↓ α_␈↓␈↓ ∧_S-expressions␈α∞whose␈α∞values␈α∞are␈α∞to␈α∞be␈α∞printed␈α∞on␈α∞both␈α∞entry␈α
and
␈↓ α_␈↓␈↓ ∧_exit␈α
to␈α
the␈αfunction.␈α
However,␈α
if␈α
␈↓αarg␈↓␈αis␈α
speci≡ed,␈α
the␈α
values␈αare
␈↓ α_␈↓␈↓ ∧_printed␈αonly␈αon␈αentry,␈αand␈αif␈α␈↓αvalue␈↓,␈αonly␈αon␈αexit.␈α Note␈αthat␈αsince
␈↓ α_␈↓␈↓ ∧_␈↓αarg,␈α⊂value,␈α⊂both,␈α⊂␈↓and␈↓α␈α⊂nil␈↓␈α⊂swallow␈α⊂all␈α⊃following␈α⊂expressions
␈↓ α_␈↓␈↓ ∧_for␈αthis␈αpurpose,␈αwhichever␈αone␈αis␈αused␈αshould␈αbe␈αthe␈αlast␈αoption
␈↓ α_␈↓␈↓ ∧_speci≡ed.␈α Any␈α
such␈αvalues␈α
printed␈αwill␈α
be␈αpreceded␈α
by␈αa␈α
␈↓α//␈↓␈αand
␈↓ α_␈↓␈↓ ∧_will follow any values speci≡ed by ␈↓αentry␈↓ or ␈↓αexit␈↓ options.
␈↓ α_␈↓␈↓ αHIf␈α∞the␈α∞variable␈α∞␈↓αarglist␈↓␈α∞is␈α∞used␈α∞in␈α
any␈α∞of␈α∞the␈α∞expressions␈α∞given␈α∞for␈α∞the␈α
␈↓αcond,
␈↓ α_␈↓αbreak,␈α⊂entry,␈α⊂␈↓or␈↓α␈α⊂exit␈↓␈α⊂options,␈α⊂or␈α∂after␈α⊂the␈α⊂␈↓αarg,␈α⊂value,␈α⊂both,␈α⊂␈↓or␈↓α␈α⊂nil␈↓␈α∂option,
␈↓ α_␈↓when␈α
those␈α
expressions␈α
are␈αevaluated␈α
the␈α
value␈α
of␈α
␈↓αarglist␈↓␈αwill␈α
e≥ectively␈α
be␈α
a␈αlist␈α
of
␈↓ α_␈↓the arguments given to the traced function. Thus
␈↓ α_␈↓␈↓ ∧λ␈↓α(trace (foo break (null (car arglist))))␈↓
␈↓ α_␈↓would cause a break in ␈↓αfoo␈↓ if and only if the ≡rst argument to ␈↓αfoo␈↓ is ␈↓αnil␈↓.
␈↓ α_␈↓␈↓ αHSimilarly,␈α
the␈α
variable␈α
␈↓αfnvalue␈↓␈α
will␈αe≥ectively␈α
be␈α
the␈α
resulting␈α
value␈α
of␈αthe␈α
traced
␈↓ α_␈↓function. For obvious reasons, this should only be used with the ␈↓αexit␈↓ option.
␈↓ α_␈↓␈↓ αHThe trace speci≡cations may be "factored." For example,
␈↓ α_␈↓␈↓ ∧ ␈↓α(trace ((foo bar) value wherein baz))␈↓
␈↓ α_␈↓is equivalent to
␈↓ α_␈↓␈↓ β⊂␈↓α(trace (foo value wherein baz) (bar value wherein baz))␈↓
␈↓ α_␈↓␈↓ αHAll␈αoutput␈α
printed␈αby␈αtrace␈α
can␈αbe␈α
ground␈αinto␈αan␈α
indented,␈αreadable␈α
format,␈αby
␈↓ α_␈↓simply␈α⊂setting␈α⊂the␈α⊂variable␈α⊂␈↓αsprinter␈↓␈α⊂to␈α⊂␈↓αt␈↓.␈α⊂ Setting␈α⊂␈↓αsprinter␈↓␈α⊂to␈α⊂␈↓αnil␈↓␈α⊂changes␈α∂the
␈↓ α_␈↓Page 3-26␈↓ ε∃␈↓∧∪3-1.5.3␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓output␈α
back␈αto␈α
use␈αthe␈α
ordinary␈αprint␈α
function,␈αwhich␈α
is␈αfaster␈α
and␈αuses␈α
less␈αstorage
␈↓ α_␈↓but is less readable for large list structures.
␈↓ α_␈↓␈↓ αxExamples of the use of ␈↓αtrace␈↓:
␈↓ α_␈↓␈↓ αx(1) To trace function ␈↓αfoo␈↓, printing both arguments on entry and result on exit:
␈↓ α_␈↓␈↓ ¬p␈↓α(trace foo)
␈↓ α_␈↓␈↓ αxor␈↓α (trace (foo)) ␈↓or␈↓α (trace (foo both))␈↓.
␈↓ α_␈↓␈↓ αx(2)␈αTo␈αtrace␈αfunction␈α␈↓αfoo␈↓␈αonly␈αwhen␈αcalled␈αfrom␈αfunction␈α␈↓αbar␈↓,␈αand␈αthen␈αonly
␈↓ α_␈↓␈↓ αHif ␈↓α(cdr x)␈↓ is ␈↓αnil␈↓:
␈↓ α_␈↓␈↓ β`␈↓α(trace (foo wherein bar cond (null (cdr x))))␈↓
␈↓ α_␈↓␈↓ αxor ␈↓α(trace (foo cond (null (cdr x)) wherein bar))␈↓
␈↓ α_␈↓␈↓ αHAs␈α
this␈α
example␈α
shows,␈α
the␈α
order␈α∞of␈α
the␈α
options␈α
makes␈α
no␈α
di≥erence,␈α∞except␈α
for
␈↓ α_␈↓␈↓ αH␈↓αarg, value, both, ␈↓or␈↓α nil␈↓, which must be last.
␈↓ α_␈↓␈↓ αx(3)␈α⊂To␈α⊂trace␈α⊂function␈α⊂␈↓αquux␈↓,␈α⊂printing␈α⊂the␈α⊂resultant␈α⊂value␈α⊂on␈α⊂exiting␈α⊂but␈α∂no
␈↓ α_␈↓␈↓ αHarguments␈αon␈αentry,␈αprinting␈αthe␈αvalue␈αof␈α␈↓α(car␈αx)␈↓␈αon␈αentry,␈αof␈α␈↓αfoo1,␈αfoo2␈↓,␈αand
␈↓ α_␈↓␈↓ αH␈↓α(foo3␈α
bar)␈↓␈α∞on␈α
exit,␈α∞and␈α
of␈α∞␈↓αzxcvbnm␈↓␈α
and␈α∞␈↓α(qwerty␈α
shrdlu)␈↓␈α∞on␈α
both␈α∞entry␈α
and
␈↓ α_␈↓␈↓ αHexit:
␈↓ α_␈↓␈↓ β_␈↓α(trace (quux entry ((car x)) exit (foo1 foo2 (foo3 bar))␈↓
␈↓ α_␈↓␈↓ ∧λ␈↓α(qwerty shrdlu)))␈↓
␈↓ α_␈↓␈↓ αx(4)␈α
To␈α
trace␈α
function␈α
␈↓αfoo␈↓␈α
only␈α
when␈α
called␈α
by␈α
functions␈α
␈↓αbar␈↓␈α
and␈α␈↓αbaz␈↓,␈α
printing
␈↓ α_␈↓␈↓ αHargs␈α∞on␈α∞entry␈α∂and␈α∞result␈α∞on␈α∂exit,␈α∞printing␈α∞the␈α∞value␈α∂of␈α∞␈↓α(quux␈α∞barf␈α∂barph)␈↓␈α∞on
␈↓ α_␈↓␈↓ αHexit␈α
from␈α∞␈↓αfoo␈↓␈α
when␈α
called␈α∞by␈α
␈↓αbaz␈↓␈α
only,␈α∞and␈α
conditionally␈α
breaking␈α∞when␈α
called
␈↓ α_␈↓␈↓ αHby ␈↓αbar␈↓ if ␈↓αa␈↓ equals ␈↓αb␈↓:
␈↓ α_␈↓α␈↓ ∧λ(trace (foo wherein bar break (equal a b))
␈↓ α_␈↓α␈↓ ∧λ (foo wherein baz exit ((quux barf barph))))
␈↓ α_␈↓␈↓ αx(5)␈α∞To␈α∞trace␈α∞functions␈α∞␈↓αphoo␈↓␈α∞and␈α∞␈↓αfu␈↓,␈α∞never␈α∞printing␈α∞anything␈α∞for␈α∞either,␈α
but
␈↓ α_␈↓␈↓ αHsaving␈α⊂all␈α⊂arguments␈α∂for␈α⊂both␈α⊂on␈α∂a␈α⊂common␈α⊂pdl␈α∂called␈α⊂␈↓αfoopdl␈↓,␈α⊂and␈α∂breaking
␈↓ α_␈↓␈↓ αHinside ␈↓αphoo␈↓ if x is ␈↓αnil␈↓:
␈↓ α_␈↓α␈↓ ∧λ(trace (phoo argpdl foopdl break (null x) cond nil nil)
␈↓ α_␈↓α␈↓ ∧λ (fu argpdl foopdl cond nil nil))
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.3␈↓␈↓ {Page 3-27
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αxThe␈α⊂"␈↓αcond␈α∂nil␈↓"␈α⊂prevents␈α⊂anything␈α∂at␈α⊂all␈α⊂from␈α∂being␈α⊂printed.␈α⊂ The␈α∂second
␈↓ α_␈↓␈↓ αH␈↓αnil␈↓␈αin␈αeach␈α
␈↓↓trace␈αspec␈↓␈αspeci≡es␈αthat␈α
no␈αargs␈αor␈αvalue␈α
are␈αto␈αbe␈α
printed;␈αalthough
␈↓ α_␈↓␈↓ αHthe␈α⊂␈↓αcond␈α∂nil␈↓␈α⊂would␈α∂prevent␈α⊂the␈α∂printout␈α⊂anyway,␈α∂specifying␈α⊂this␈α⊂too␈α∂prevents
␈↓ α_␈↓␈↓ αH␈↓αtrace␈↓ from even setting up the mechanisms to do this.
␈↓ α_␈↓␈↓ αx(6)␈α
To␈α
trace␈α
function␈α␈↓αfoobar␈↓,␈α
printing␈α
args␈α
on␈αentry␈α
and␈α
result␈α
on␈α
exit,␈αplus
␈↓ α_␈↓␈↓ αHthe value of ␈↓αmoby-expr␈↓ on exit, and pretty-printing the output:
␈↓ α_␈↓α␈↓ ∧λ(trace (foobar grind exit (moby-expr)))
␈↓ α_␈↓␈↓ αH␈↓αtrace␈↓␈α∪returns␈α∪as␈α∪its␈α∪value␈α∪a␈α∪list␈α∪of␈α∪names␈α∪of␈α∪all␈α∪functions␈α∪traced;␈α∀for␈α∪any
␈↓ α_␈↓functions␈αtraced␈α
with␈αthe␈α␈↓αwherein␈↓␈α
option,␈αsay␈α␈↓α(trace␈α
(foo␈αwherein␈α
bar))␈↓,␈αinstead
␈↓ α_␈↓of␈α∞returning␈α∞just␈α∞␈↓αfoo␈↓␈α∂it␈α∞returns␈α∞a␈α∞3-list␈α∞␈↓α(foo␈α∂wherein␈α∞bar)␈↓.␈α∞ If␈α∞trace␈α∞≡nds␈α∂a␈α∞␈↓↓trace
␈↓ α_␈↓↓spec␈↓␈αit␈αdoesn't␈αlike,␈αinstead␈αof␈αthe␈αfunction's␈αname␈αit␈αreturns␈αa␈αlist␈αwhose␈αcar␈αis␈α␈↓α?␈↓␈αand
␈↓ α_␈↓whose cdr is an error message. The error messages are:
␈↓ α_␈↓␈↓α(?␈αwherein␈α
foo)␈α trace␈↓␈αcouldn't␈α
≡nd␈αan␈α
␈↓αexpr,␈αfexpr,␈↓␈αor␈α
␈↓αmacro␈↓␈αproperty␈α
for␈αthe
␈↓ α_␈↓␈↓ ∧_function speci≡ed by the ␈↓αwherein␈↓ option.
␈↓ α_␈↓␈↓α(?␈α
argpdl␈α∞foo)␈↓␈α
The␈α∞item␈α
following␈α∞the␈α
␈↓αargpdl␈↓␈α∞option␈α
was␈α∞not␈α
a␈α∞non-␈↓αnil␈↓␈α
atomic
␈↓ α_␈↓␈↓ ∧_symbol.
␈↓ α_␈↓␈↓α(?␈α∞foo␈α∞not␈α
function)␈↓␈α∞ Indicates␈α∞that␈α
the␈α∞function␈α∞speci≡ed␈α
to␈α∞be␈α∞traced␈α∞was␈α
non-
␈↓ α_␈↓␈↓ ∧_atomic,␈α≤or␈α≠had␈α≤no␈α≠functional␈α≤property.␈α≤ (Valid␈α≠functional
␈↓ α_␈↓␈↓ ∧_properties␈α≤are␈α≥␈↓αexpr,␈α≤fexpr,␈α≥subr,␈α≤fsubr,␈α≥lsubr,␈α≤␈↓and␈↓α
␈↓ α_␈↓α␈↓ ∧_macro␈↓.)
␈↓ α_␈↓␈↓α(? foo)␈↓␈↓ ∧_foo is not a valid option.
␈↓ α_␈↓␈↓ αHThus a use of ␈↓αtrace␈↓ such as
␈↓ α_␈↓␈↓ βh␈↓α(trace (foo wherein (nil)) (bar argpdl nil))␈↓
␈↓ α_␈↓would return, without setting up any traces,
␈↓ α_␈↓␈↓ ∧8␈↓α((? wherein (nil)) (? argpdl nil))␈↓
␈↓ α_␈↓␈↓ αHIf␈α∞you␈α∞attempt␈α∞to␈α∞specify␈α∞to␈α∞␈↓αtrace␈↓␈α∞a␈α∞function␈α∞already␈α∞being␈α∞traced,␈α∞␈↓αtrace␈↓␈α
calls
␈↓ α_␈↓␈↓αuntrace␈↓␈αbefore␈αsetting␈αup␈αthe␈αnew␈αtrace.␈α If␈αan␈αerror␈αoccurs,␈αcausing␈α␈↓α(?␈αsomething)␈↓
␈↓ α_␈↓to␈αbe␈αreturned,␈αthe␈αfunction␈αfor␈αwhich␈αthe␈αerror␈αoccurred␈αmay␈αor␈αmay␈αnot␈αhave␈αbeen
␈↓ α_␈↓untraced. Beware!
␈↓ α_␈↓␈↓ αHIt␈αis␈αpossible␈αto␈αcall␈α␈↓αtrace␈↓␈αwith␈αno␈αarguments.␈α ␈↓α(trace)␈↓␈αevaluates␈αto␈αa␈αlist␈αof␈αall
␈↓ α_␈↓the functions currently being traced.
␈↓ α_␈↓Page 3-28␈↓ ε∃␈↓∧∪3-1.5.3␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αH␈↓αuntrace␈↓␈α∩is␈α⊃used␈α∩to␈α∩undo␈α⊃the␈α∩e≥ects␈α⊃of␈α∩␈↓αtrace␈↓␈α∩and␈α⊃restore␈α∩functions␈α∩to␈α⊃their
␈↓ α_␈↓normal,␈α∞untraced␈α∂state.␈α∞ The␈α∂argument␈α∞to␈α∞␈↓αuntrace␈↓␈α∂for␈α∞a␈α∂given␈α∞function␈α∂should␈α∞be
␈↓ α_␈↓what␈α␈↓αtrace␈↓␈αreturned␈αfor␈αit;␈αi.e.␈αif␈α␈↓αtrace␈↓␈αreturned␈α␈↓αfoo␈↓,␈αuse␈α␈↓α(untrace␈αfoo)␈↓;␈αif␈α␈↓αtrace␈↓
␈↓ α_␈↓returned␈α⊃␈↓α(foo␈α⊃wherein␈α⊃bar)␈↓␈α⊃use␈α⊃␈↓α(untrace␈α⊃(foo␈α⊃wherein␈α⊃bar))␈↓.␈α∩ ␈↓αuntrace␈↓␈α⊃will
␈↓ α_␈↓take␈α∂multiple␈α∂speci≡cations,␈α∂e.g.␈α∂␈↓α(untrace␈α∂foo␈α∂quux␈α∂(bar␈α∂wherein␈α⊂baz)␈α∂fuphoo)␈↓.
␈↓ α_␈↓Calling ␈↓αuntrace␈↓ with no arguments will untrace all functions currently being traced.
␈↓ α_␈↓␈↓ αH␈↓αremtrace␈↓,␈α↔oddly␈α_enough,␈α↔expunges␈α_the␈α↔entire␈α↔trace␈α_package.␈α↔ It␈α_takes␈α↔no
␈↓ α_␈↓arguments.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.3␈↓␈↓ zPage 3-29
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.5.4 The Stepper␈↓
␈↓ α_␈↓␈↓ αHThe␈α∞LISP␈α∂Stepper␈α∞package␈α∞provides␈α∂debugging␈α∞capabilities␈α∞for␈α∂interpreted␈α∞lisp
␈↓ α_␈↓programs␈α∂that␈α⊂are␈α∂comparable␈α⊂to␈α∂the␈α⊂capabilities␈α∂provided␈α⊂by␈α∂DDT␈α⊂for␈α∂assembler
␈↓ α_␈↓code. These capabilities include:
␈↓ α_␈↓␈↓ αH1)␈α∞Single␈α∞stepping␈α∞through␈α∞the␈α∞evaluation␈α∞of␈α∞a␈α∞function␈α∞and␈α∞over␈α∞or␈α∂into␈α∞other
␈↓ α_␈↓interpreted␈α⊂functions,␈α⊂when␈α⊂called,␈α⊂on␈α⊂a␈α∂selective␈α⊂basis␈α⊂as␈α⊂determined␈α⊂by␈α⊂the␈α∂user.
␈↓ α_␈↓Each such form and its resulting value may be displayed.
␈↓ α_␈↓␈↓ αH2)␈αDynamic␈αbreakpointing␈αon␈αone␈αor␈αmore␈αof␈αthe␈αfollowing␈αconditions:␈α the␈αform
␈↓ α_␈↓or␈α∪atom␈α∩about␈α∪to␈α∪be␈α∩evaluated␈α∪matches␈α∩a␈α∪pattern␈α∪you␈α∩provide;␈α∪the␈α∪form␈α∩being
␈↓ α_␈↓evaluated␈α∞involves␈α
a␈α∞speci≡ed␈α
function;␈α∞a␈α
given␈α∞atomic␈α
symbol␈α∞evaluates␈α
to␈α∞a␈α
given
␈↓ α_␈↓value;␈α⊂a␈α∂given␈α⊂atomic␈α∂symbol␈α⊂is␈α∂to␈α⊂be␈α∂bound␈α⊂in␈α∂a␈α⊂␈↓αprog␈↓,␈α∂either␈α⊂type␈α∂of␈α⊂␈↓αdo␈↓,␈α⊂or␈α∂an
␈↓ α_␈↓␈↓αeval␈↓'d␈α⊂␈↓αlambda␈↓-expression;␈α∂or␈α⊂upon␈α∂an␈α⊂arbitrary␈α∂condition␈α⊂speci≡ed␈α∂by␈α⊂a␈α∂predicate
␈↓ α_␈↓written as LISP code.
␈↓ α_␈↓␈↓ αH3)␈α
Returning␈α
a␈α
di≥erent␈α
value␈α
for␈α
a␈α
given␈α
S-expression.␈α
This␈α
allows␈αfor␈α
changing
␈↓ α_␈↓the␈αaction␈αthat␈αwould␈αbe␈αselected␈αby␈αconditionals␈αin␈αthe␈αprogram␈αand/or␈αby␈α␈↓αgo␈↓'s␈αin␈αa
␈↓ α_␈↓␈↓αprog␈↓ or ␈↓αdo␈↓. You can also ␈↓αgo␈↓ to any tag inside the current ␈↓αprog␈↓.
␈↓ α_␈↓␈↓ αH4)␈αThese␈αcapabilities␈αmay␈αbe␈αrequested␈αwhen␈αthe␈αprogram␈αis␈αinitially␈αstarted␈αby␈αa
␈↓ α_␈↓top-level␈αform,␈αor␈αthey␈αmay␈αbe␈αinitiated␈αat␈αany␈αother␈αpoint␈αin␈αthe␈αcourse␈αof␈αexecution
␈↓ α_␈↓- either from the terminal while in a breakpoint, or directly by the program.
␈↓ α_␈↓␈↓ αHThe␈αstepper␈αmay␈αbe␈αinvoked␈αinitially␈αby␈αusing␈αthe␈αfunction␈α␈↓αmev␈↓␈αas␈αone␈αwould␈α
use
␈↓ α_␈↓␈↓αeval␈↓␈α∞of␈α
one␈α∞argument;␈α∞e.g.␈α
␈↓α(mev␈α∞'(fcn␈α∞arg1␈α
arg2))␈↓.␈α∞ From␈α∞a␈α
breakpoint␈α∞or␈α∞in␈α
a
␈↓ α_␈↓program,␈α
the␈αstepper␈α
may␈αbe␈α
turned␈α
on␈αby␈α
invoking␈α␈↓α(hkstart)␈↓␈α
with␈α
no␈αarguments.
␈↓ α_␈↓It␈α
may␈α
be␈α
turned␈α
o≥␈α
by␈α
the␈α␈↓αq␈↓␈α
command␈α
described␈α
below,␈α
or␈α
of␈α
course␈α
by␈αcontrol-G.
␈↓ α_␈↓After␈α␈↓αmev␈↓␈αevaluates␈αits␈α
argument,␈αit␈αreturns␈αthe␈αvalue␈α
and␈αturns␈αo≥␈αthe␈αstepper.␈α
Note
␈↓ α_␈↓that␈α
in␈α
the␈αabove␈α
example␈α
the␈αform␈α
given␈α
as␈αan␈α
argument␈α
to␈α␈↓αmev␈↓␈α
was␈α
quoted.␈α If,␈α
say,
␈↓ α_␈↓the␈α
value␈α
of␈α
␈↓αf␈↓␈α
was␈α
the␈α
S-expression␈α
␈↓α(fcn␈α
arg1␈α
arg2)␈↓,␈α
then␈α
one␈α
could␈α
use␈α
␈↓α(mev␈α
f)␈↓
␈↓ α_␈↓instead.
␈↓ α_␈↓␈↓ αHAt␈αany␈αpoint␈α
during␈αthe␈αstepping,␈α
one␈αmay␈αinspect␈α
the␈αvalues␈αof␈α
other␈αvariables,
␈↓ α_␈↓and␈αeven␈αreapply␈α␈↓αmev␈↓␈αto␈αany␈αform.␈α This␈αmay␈αbe␈αdone␈αin␈αeither␈αof␈αthree␈αways.␈α Each
␈↓ α_␈↓command␈α∞will␈α∂be␈α∞prompted␈α∞for␈α∂by␈α∞␈↓α//␈↓,␈α∂usually␈α∞following␈α∞the␈α∂last␈α∞form␈α∂printed␈α∞out.
␈↓ α_␈↓Any␈αS-expression␈αthat␈αyou␈α
type␈αwhich␈αis␈αnot␈αrecognized␈α
as␈αa␈αcommand␈αwill␈αbe␈α
␈↓αeval␈↓'d
␈↓ α_␈↓(within␈α⊂an␈α∂␈↓αerrset␈↓␈α⊂to␈α⊂catch␈α∂errors).␈α⊂ Alternatively,␈α∂you␈α⊂can␈α⊂use␈α∂the␈α⊂␈↓αe␈↓␈α⊂command␈α∂to
␈↓ α_␈↓␈↓αeval␈↓␈αany␈αexpression,␈αor␈αthe␈α␈↓αh␈↓␈αcommand␈αto␈αget␈αa␈αnice␈αtype␈αof␈αcontrol-H␈αbreak.␈α (This
␈↓ α_␈↓is␈αreally␈α
a␈αcontrol-B␈α
break,␈αbut␈α
it␈αused␈α
to␈αbe␈α
control-H␈αso␈α
the␈αcommand␈α
happens␈αto␈α
be
␈↓ α_␈↓called ␈↓αh␈↓.)
␈↓ α_␈↓Page 3-30␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αHIn␈α
the␈α
ITS␈α
implementation␈α
each␈α
command␈α
must␈α
be␈α
followed␈α
by␈α
a␈α
space␈α(unless␈α
the
␈↓ α_␈↓command␈α
is␈α
a␈α
list).␈α
In␈α
the␈αMultics␈α
implementation␈α
each␈α
command␈α
must␈α
be␈αfollowed
␈↓ α_␈↓by␈α⊃a␈α⊂newline.␈α⊃ Actually,␈α⊂this␈α⊃depends␈α⊂not␈α⊃on␈α⊂the␈α⊃implementation␈α⊂but␈α⊃on␈α⊂␈↓α(status
␈↓ α_␈↓αlinmode)␈↓.␈α
Each␈α
form␈α
and␈α
result␈α
which␈α∞is␈α
printed␈α
out␈α
will␈α
be␈α
followed␈α∞by␈α
␈↓α#␈↓↓number␈↓
␈↓ α_␈↓indicating the relative level of evaluation (i.e. stack depth since invocation).
␈↓ α_␈↓␈↓ αHThe primary commands are:
␈↓ α_␈↓␈↓αd␈↓␈α (mnemonic␈αfor␈αdown)␈αGo␈αdown␈αto␈αthe␈αnext␈αdeeper␈αlevel␈αof␈αevaluation␈αand␈αdisplay
␈↓ α_␈↓␈↓ αHthe␈α
≡rst␈αform␈α
there␈αbefore␈α
evaluating␈αit.␈α
E.g.␈αif␈α
the␈αform␈α
is␈αa␈α
function␈α
call,␈αthis
␈↓ α_␈↓␈↓ αHwill␈α∂display␈α∂the␈α⊂≡rst␈α∂argument␈α∂of␈α⊂the␈α∂function␈α∂if␈α∂it␈α⊂has␈α∂arguments␈α∂in␈α⊂the␈α∂call;
␈↓ α_␈↓␈↓ αHotherwise␈α
it␈α
will␈α
display␈α
the␈α
≡rst␈α
S-expression␈α
of␈α
the␈α
function.␈α
It␈α
then␈αprompts␈α
for
␈↓ α_␈↓␈↓ αHthe next command.
␈↓ α_␈↓␈↓αe␈↓␈α (eval)␈αCan␈αbe␈αused␈αto␈αevaluate␈αan␈αarbitrary␈αexpression.␈α It␈αstarts␈αa␈αnew␈α
line,␈αwaits
␈↓ α_␈↓␈↓ αHfor␈α∞you␈α
to␈α∞type␈α∞the␈α
expression,␈α∞then␈α∞␈↓αeval␈↓'s␈α
it␈α∞within␈α∞an␈α
␈↓αerrset␈↓,␈α∞and␈α∞prints␈α
the
␈↓ α_␈↓␈↓ αHresult.␈α This␈αis␈αcomparable␈αto␈αjust␈αtyping␈αthe␈αexpression␈αor␈αatom␈αafter␈αthe␈α␈↓α//␈↓,␈αbut
␈↓ α_␈↓␈↓ αHcannot be confused with a command, and the format is nicer.
␈↓ α_␈↓␈↓αh␈↓␈α (control-H)␈αExecutes␈αa␈αcontrol-H␈αbreak,␈αand␈αwhen␈α␈↓α$p␈↓'ed␈αdisplays␈αthe␈αcurrent␈αform.
␈↓ α_␈↓␈↓ αHWithin␈αthe␈αbreak,␈α
one␈αcan␈αinspect␈α
the␈αvalues␈αof␈α
variables,␈αetc.,␈αand␈α
even␈αreapply
␈↓ α_␈↓␈↓ αH␈↓αmev␈↓ to any form.
␈↓ α_␈↓␈↓αn␈↓␈α⊃ (next)␈α⊃Display␈α∩the␈α⊃next␈α⊃form␈α∩at␈α⊃this␈α⊃level,␈α∩without␈α⊃showing␈α⊃or␈α∩inspecting␈α⊃the
␈↓ α_␈↓␈↓ αHevaluation␈α
of␈α
the␈α
lower␈α
levels␈α
of␈αthe␈α
current␈α
form.␈α
The␈α
value␈α
of␈α
the␈αcurrent␈α
form
␈↓ α_␈↓␈↓ αHis␈αdisplayed␈α≡rst.␈α If␈αyou␈α
wish␈αa␈αcondition␈αto␈αbe␈α
tested␈αfor␈αat␈αlower␈αlevels,␈α
use␈α␈↓αnn␈↓
␈↓ α_␈↓␈↓ αHinstead.
␈↓ α_␈↓␈↓αnn␈↓␈αLike␈α␈↓αn␈↓␈αbut␈αslower␈αsince␈αit␈αinspects␈αthe␈αlower␈αlevels.␈α Use␈αinstead␈αof␈α␈↓αn␈↓␈αwhen␈αtesting
␈↓ α_␈↓␈↓ αHfor a condition.
␈↓ α_␈↓␈↓αu␈↓␈α (up)␈αGo␈αup␈αto␈αthe␈αnext␈αhigher␈αlevel␈αof␈αevaluation␈αand␈αshow␈αthe␈αnext␈αform␈αat␈αthat
␈↓ α_␈↓␈↓ αHlevel.␈α The␈αform(s)␈α
at␈αthe␈αcurrent␈αand␈α
lower␈αlevels␈αare␈αevaluated␈α
without␈αdisplay.
␈↓ α_␈↓␈↓ αHAs␈αan␈αexample␈αof␈αits␈αuse,␈αafter␈αyou␈αhave␈αseen␈αthe␈αevaluation␈αof␈αthe␈αarguments␈αto
␈↓ α_␈↓␈↓ αHa␈α
function,␈α
the␈α
next␈α
form␈α
to␈αbe␈α
evaluated,␈α
if␈α
the␈α
function␈α
is␈α
being␈αinterpreted,␈α
will
␈↓ α_␈↓␈↓ αHbe␈α⊂the␈α⊂≡rst␈α⊂S-expression␈α⊂of␈α⊂the␈α⊃function;␈α⊂to␈α⊂avoid␈α⊂seeing␈α⊂how␈α⊂the␈α⊃function␈α⊂is
␈↓ α_␈↓␈↓ αHevaluated␈α
internally,␈αyou␈α
can␈α
type␈α␈↓αu␈↓.␈α
Note␈α
that␈αthe␈α
lower␈α
levels␈αare␈α
not␈αinspected␈α
-
␈↓ α_␈↓␈↓ αHthus if a condition is to be tested for at these levels, use ␈↓αuu␈↓.
␈↓ α_␈↓␈↓α(u␈α∂␈↓↓num␈↓α)␈↓␈α∞ If␈α∂␈↓↓num␈↓␈α∂is␈α∞positive␈α∂(or␈α∂zero),␈α∞forms␈α∂are␈α∂not␈α∞inspected␈α∂nor␈α∂displayed␈α∞until
␈↓ α_␈↓␈↓ αHlevel␈α␈↓↓num␈↓␈αis␈αreturned␈αto.␈α If␈αnegative,␈αit␈αgoes␈αup␈α␈↓α(abs␈α␈↓↓num␈↓α)␈↓␈αlevels␈αrelative␈αto␈αthe
␈↓ α_␈↓␈↓ αHcurrent level. Thus ␈↓α(u -1)␈↓ is equivalent to ␈↓αu␈↓.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓
↓Page 3-31
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αuu␈↓ Like ␈↓αu␈↓ but slower. Use if testing for a condition.
␈↓ α_␈↓␈↓α(uu ␈↓↓num␈↓α)␈↓ Like ␈↓α(u ␈↓↓num␈↓α)␈↓ but slower. Use if testing for a condition.
␈↓ α_␈↓␈↓αq␈↓ (quit) Exit from the stepper.
␈↓ α_␈↓␈↓αs␈↓␈α∞ (show␈α
or␈α∞display␈α
mode)␈α∞ For␈α
datapoints␈α∞and␈α
other␈α∞display␈α
terminals,␈α∞this␈α∞gives␈α
a
␈↓ α_␈↓␈↓ αHnice␈αeasily␈αread␈αoutput␈αof␈αselected␈αlevels␈αthat␈αconstitute␈αthe␈αcontext␈αof␈αthe␈αcurrent
␈↓ α_␈↓␈↓ αHevaluation.␈α
Speci≡cally,␈αit␈α
selects␈αthe␈α
current␈α
level␈αfor␈α
sprinting␈αas␈α
a␈α"header",␈α
and
␈↓ α_␈↓␈↓ αHas␈α
you␈α∞go␈α
deeper,␈α∞the␈α
local␈α
context␈α∞is␈α
abbreviate-printed␈α∞under␈α
this␈α∞header,␈α
and
␈↓ α_␈↓␈↓ αHthe␈αcurrent␈α
output␈αwill␈αbe␈α
sprinted.␈α ␈↓αs␈↓␈α
may␈αbe␈αused␈α
as␈αoften␈α
as␈αyou␈αlike.␈α
Headers
␈↓ α_␈↓␈↓ αHwill␈αautomatically␈αbe␈αpopped␈αwhen␈α
you␈αreturn.␈α The␈αcommand␈α␈↓α(s␈α␈↓↓num␈↓α)␈↓␈α
selects␈αa
␈↓ α_␈↓␈↓ αHparticular␈α∂level␈α∂as␈α∞a␈α∂header.␈α∂ It␈α∞and␈α∂the␈α∂command␈α∞␈↓αsn␈↓␈α∂and␈α∂several␈α∂user␈α∞settable
␈↓ α_␈↓␈↓ αHparameters are described in the more detailed section below.
␈↓ α_␈↓␈↓α(=␈α␈↓↓s-exp␈↓α␈↓␈α The␈αS-expression␈αis␈αsubstituted␈αfor␈αthe␈αcurrent␈αform␈αand␈αanother␈αcommand
␈↓ α_␈↓␈↓ αHis␈α∂prompted␈α⊂for␈α∂(i.e.␈α⊂you␈α∂can␈α⊂step␈α∂into␈α∂or␈α⊂over␈α∂the␈α⊂new␈α∂form␈α⊂if␈α∂you␈α⊂want␈α∂to).
␈↓ α_␈↓␈↓ αHWhen␈α
the␈α
resulting␈α
value␈αis␈α
returned␈α
it␈α
will␈α
be␈αas␈α
if␈α
the␈α
original␈α
form␈αhad␈α
yielded
␈↓ α_␈↓␈↓ αHthat␈α∀value.␈α∀ For␈α∀example,␈α∀you␈α∃can␈α∀change␈α∀the␈α∀apparent␈α∀truth␈α∀or␈α∃falsity␈α∀of
␈↓ α_␈↓␈↓ αHpredicates␈αor␈αbypass␈αa␈α␈↓α(go␈α␈↓↓label␈↓α)␈↓,␈αas␈αwell␈αas␈αjust␈αreturning␈αdi≥erent␈αvalues␈αfor␈αan
␈↓ α_␈↓␈↓ αHS-expression.
␈↓ α_␈↓␈↓α(cond␈α...)␈↓␈α Tests␈αfor␈αconditions␈αprior␈αto␈αevaluation␈αof␈αeach␈αfuture␈αform,␈αand␈αwhen
␈↓ α_␈↓␈↓ αHsatis≡ed␈α∞will␈α∞print␈α∞a␈α∞message,␈α∂display␈α∞the␈α∞form,␈α∞and␈α∞wait␈α∞for␈α∂another␈α∞command
␈↓ α_␈↓␈↓ αH(which␈α⊃may␈α∩of␈α⊃course␈α∩be␈α⊃␈↓αh␈↓␈α⊃for␈α∩a␈α⊃break).␈α∩ The␈α⊃argument␈α⊃to␈α∩this␈α⊃␈↓αcond␈↓␈α∩is␈α⊃an
␈↓ α_␈↓␈↓ αHarbitrary␈α⊃S-expression␈α⊂or␈α⊃symbol␈α⊂which␈α⊃is␈α⊂evaluated␈α⊃like␈α⊂a␈α⊃predicate.␈α⊃ This␈α⊂is
␈↓ α_␈↓␈↓ αHsimilar to the ␈↓αcond␈↓ feature of the trace package.
␈↓ α_␈↓␈↓ αHIn␈α
specifying␈α∞the␈α
predicate,␈α
the␈α∞form␈α
about␈α∞to␈α
be␈α
evaluated␈α∞may␈α
be␈α∞obtained␈α
as
␈↓ α_␈↓␈↓ αHthe␈α∩value␈α∩of␈α∩the␈α∩variable␈α∩␈↓α%%form␈↓.␈α∩ The␈α∩expression␈α∩␈↓α(hooklevel)␈↓␈α∩returns␈α∩the
␈↓ α_␈↓␈↓ αHrelative␈α
level␈α
of␈α
evaluation.␈α
More␈α
than␈αone␈α
predicate␈α
may␈α
be␈α
given,␈α
in␈αwhich␈α
case
␈↓ α_␈↓␈↓ αHthey␈α∀are␈α∀or'ed␈α∃together,␈α∀except␈α∀when␈α∀two␈α∃arguments␈α∀form␈α∀a␈α∀special␈α∃test␈α∀as
␈↓ α_␈↓␈↓ αHdescribed␈αin␈αthe␈αmore␈αdetailed␈αsection␈αbelow.␈α The␈αcondition␈αwill␈αremain␈αactive␈αat
␈↓ α_␈↓␈↓ αHall␈α∂levels␈α∂that␈α∂are␈α∂inspected␈α∂by␈α∂the␈α∂stepper␈α∂until␈α∂explicitly␈α∂turned␈α∂o≥␈α∂by␈α∞␈↓α(cond
␈↓ α_␈↓α␈↓ αHnil)␈↓.
␈↓ α_␈↓␈↓ αH␈↓α(matchf␈α...)␈↓␈αis␈αa␈αfunction␈αwhich␈αwill␈αpattern␈αmatch␈αagainst␈αthe␈αcurrent␈αform.␈αIt
␈↓ α_␈↓␈↓ αHmay␈α
be␈α
used␈α
in␈α
the␈α
predicate␈α
of␈α
the␈α
␈↓αcond␈↓.␈α
(Also␈α
see␈α
its␈α
related␈α
use␈α
as␈αa␈α
command.)
␈↓ α_␈↓␈↓ αHThe␈αargument␈αto␈α␈↓αmatchf␈↓␈αis␈αcompared␈αto␈α␈↓α%%form␈↓␈αelement␈αby␈αelement␈αfrom␈αleft␈αto
␈↓ α_␈↓␈↓ αHright,␈α∞and␈α∞succeeds␈α∞when␈α∞each␈α∞element␈α∞of␈α∞the␈α∞pattern␈α∞succeeds.␈α∞ Of␈α
importance,
␈↓ α_␈↓␈↓ αHthe␈α
pattern␈α
need␈α
not␈α
include␈αthe␈α
entire␈α
form.␈α
␈↓α*␈↓␈α
matches␈α
anything.␈α The␈α
procedure
␈↓ α_␈↓␈↓ αHis␈α⊂applied␈α⊂recursively␈α⊂to␈α⊂sublists,␈α⊂unless␈α⊂the␈α∂sublist␈α⊂is␈α⊂of␈α⊂the␈α⊂form␈α⊂␈↓α(#␈α⊂...)␈↓␈α∂in
␈↓ α_␈↓Page 3-32␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αHwhich␈αcase␈α␈↓α#␈↓␈αis␈αbound␈αto␈αthe␈αcurrent␈α
element␈αof␈α␈↓α%%form␈↓␈αand␈αthe␈αcdr␈α(not␈αcadr)␈α
of
␈↓ α_␈↓␈↓ αHthe␈α␈↓α#␈↓-list␈αis␈αevaluated␈αas␈αthe␈αtest␈αon␈αthat␈αelement.␈α Except␈αin␈αthis␈αcase,␈αatoms␈αand
␈↓ α_␈↓␈↓ αHlists␈α
should␈α
be␈α
given␈α
as␈α
in␈α
the␈αoriginal␈α
code␈α
since␈α
they␈α
are␈α
not␈α
evaluated.␈α Some
␈↓ α_␈↓␈↓ αHsimple examples are:
␈↓ α_␈↓␈↓ αx␈↓α(matchf xyz)␈↓ succeeds if the atom ␈↓αxyz␈↓ is about to be evaluated.
␈↓ α_␈↓␈↓ αx␈↓α(matchf (setq alpha))␈↓ succeeds if the atom ␈↓αalpha␈↓ is about to be ␈↓αsetq␈↓'d.
␈↓ α_␈↓␈↓ αx␈↓α(matchf␈α⊂(putprop␈α⊂name␈α∂*␈α⊂'source))␈↓␈α⊂ succeeds␈α∂if␈α⊂the␈α⊂property␈α⊂␈↓αsource␈↓␈α∂is
␈↓ α_␈↓␈↓ β(about to be ␈↓αputprop␈↓'d on the atom pointed to by (i.e. the value of) ␈↓αname␈↓.
␈↓ α_␈↓␈↓ αx␈↓α(matchf␈α∃(setq␈α⊗(#␈α∃member␈α⊗#␈α∃'(alpha␈α∃beta␈α⊗s3))))␈↓␈α∃succeeds␈α⊗if␈α∃either
␈↓ α_␈↓␈↓ β(␈↓αalpha, beta,␈↓ or␈↓αs3␈↓ is about to be ␈↓αsetq␈↓'d.
␈↓ α_␈↓␈↓ αx␈↓α(matchf␈α∀(rplacd␈α∀*␈α∀'(*␈α∃9)))␈↓␈α∀matches␈α∀␈↓α(rplacd␈α∀(last␈α∀urlist)␈α∃'(2␈α∀9
␈↓ α_␈↓α␈↓ β(4))␈↓.
␈↓ α_␈↓␈↓ αx␈↓α(matchf␈α∞((#␈α∞member␈α∞#␈α∞'(foo␈α∞bar))))␈↓␈α∞succeeds␈α∞if␈α∞a␈α∞function␈α∞call␈α∞to␈α
either
␈↓ α_␈↓␈↓ β(␈↓αfoo␈↓␈αor␈α␈↓αbar␈↓␈αis␈αabout␈αto␈αbe␈αevaluated␈α(more␈αprecisely␈αif␈αthe␈αcar␈αof␈αthe␈αform
␈↓ α_␈↓␈↓ β(about to be evaluated is either ␈↓αfoo␈↓ or ␈↓αbar␈↓).
␈↓ α_␈↓␈↓αnil (cond nil)␈↓ turns the condition o≥ and saves the current non-␈↓αnil␈↓ condition.
␈↓ α_␈↓␈↓α(cond)␈↓␈α∞When␈α∂no␈α∞argument␈α∞is␈α∂given,␈α∞the␈α∂last␈α∞non-␈↓αnil␈↓␈α∞condition␈α∂(which␈α∞is␈α∂the␈α∞␈↓αold␈↓
␈↓ α_␈↓␈↓ αHproperty␈αof␈α␈↓α%%cond␈↓)␈αis␈αestablished␈αas␈αthe␈αcurrent␈αcondition␈α(which␈αis␈αthe␈αvalue␈αof
␈↓ α_␈↓␈↓ αH␈↓α%%cond␈↓).␈α⊂ (If␈α⊃the␈α⊂previous␈α⊂condition␈α⊃was␈α⊂not␈α⊂␈↓αnil␈↓␈α⊃then␈α⊂it␈α⊂is␈α⊃saved␈α⊂as␈α⊃the␈α⊂␈↓αold␈↓
␈↓ α_␈↓␈↓ αHproperty, thus allowing for alternation of two conditions.)
␈↓ α_␈↓␈↓α(matchf ...)␈↓ is equivalent to ␈↓α(cond (matchf ...))␈↓, see above.
␈↓ α_␈↓␈↓ αHThe following functions are useful in connection with the stepper.
␈↓ α_␈↓␈↓ αH␈↓α(hkstart)␈↓␈αwill␈αinitiate␈αstepping␈αwhen␈αencountered␈αin␈αa␈αprogram␈αor␈αtyped␈αfrom␈α
a
␈↓ α_␈↓breakpoint.␈α∂ ␈↓α(hkstop)␈↓␈α∂will␈α⊂act␈α∂like␈α∂the␈α⊂␈↓αq␈↓␈α∂command␈α∂to␈α⊂turn␈α∂o≥␈α∂stepping.␈α⊂(Also␈α∂see
␈↓ α_␈↓below for more info.)
␈↓ α_␈↓␈↓ αH␈↓α(mbak)␈↓␈α
is␈α
a␈αfunction␈α
to␈α
be␈αused␈α
like␈α
the␈αlisp␈α
system's␈α
␈↓α(baklist)␈↓.␈α
␈↓α(mbak)␈↓␈αstrips
␈↓ α_␈↓out from the result of ␈↓α(baklist)␈↓ those functions that have to do with the stepper.
␈↓ α_␈↓␈↓ αHThe␈αremainder␈αof␈αthis␈αsection␈αis␈αa␈αcomplete␈αlist␈αof␈αthe␈αStepper␈α
commands,␈αwhich
␈↓ α_␈↓can be used for reference.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ ⎇Page 3-33
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αHCommands␈αwhich␈αare␈αnot␈αlists␈αmust␈αbe␈αfollowed␈αby␈αa␈αspace.␈α You␈αcan␈αuse␈αrubout
␈↓ α_␈↓before␈α
completing␈α
the␈α
command␈α
(and␈α
its␈α
space␈α
if␈α
necessary).␈α
Alternatively,␈α
you␈αmay
␈↓ α_␈↓abort the command before completing it by doing control-X.
␈↓ α_␈↓␈↓ αHAny␈α∂S-expression␈α∞that␈α∂you␈α∂type␈α∞which␈α∂is␈α∞not␈α∂recognized␈α∂as␈α∞a␈α∂command␈α∂will␈α∞be
␈↓ α_␈↓evaluated␈α(within␈αan␈α␈↓αerrset␈↓␈αto␈αcatch␈αerrors).␈α
Thus␈αyou␈αcan␈αevaluate␈αany␈αatom␈αor␈α
do
␈↓ α_␈↓any␈αfunction␈αcall␈αsimply␈αby␈αtyping␈αit␈αfollowing␈αthe␈αprompting␈α␈↓α//␈↓␈αas␈αlong␈αas␈αit␈αis␈αnot
␈↓ α_␈↓interpretable␈αas␈αone␈αof␈αthe␈αcommands␈αbelow␈α(or␈α␈↓αnil␈↓).␈α Note␈αthat␈αyou␈αcan␈αactually␈α␈↓αgo␈↓
␈↓ α_␈↓to␈α∂a␈α∂␈↓↓tag␈↓␈α∂within␈α∂your␈α∂␈↓αprog␈↓␈α∂simply␈α∂by␈α∞typing␈α∂␈↓α(go␈α∂␈↓↓tag␈↓α␈↓␈α∂after␈α∂the␈α∂␈↓α//␈↓.␈α∂ To␈α∂evaluate␈α∞a
␈↓ α_␈↓form␈α∪which␈α∀looks␈α∪like␈α∀a␈α∪command,␈α∀type␈α∪␈↓α(or␈α∪␈↓↓form␈↓α)␈↓␈α∀to␈α∪evaluate␈α∀it,␈α∪e.g.␈α∀␈↓α(or␈α∪a)␈↓
␈↓ α_␈↓evaluates␈αthe␈αatom␈α
␈↓αa␈↓.␈α (If␈αyou␈α
want␈αyou␈αcan␈αeven␈α
write␈αfunctions␈αwhich␈α
know␈αabout
␈↓ α_␈↓the stepper and treat them as commands.)
␈↓ α_␈↓␈↓αa␈↓␈α (all)␈αAutomatically␈αdisplays␈αall␈αforms␈αand␈αvalues␈αseen␈αby␈αthe␈αstepper␈αat␈αall␈αlevels.
␈↓ α_␈↓␈↓ αhTyping␈αa␈αspace␈αat␈αany␈αtime␈αthereafter␈αwill␈αcause␈αthe␈αstepper␈αto␈αleave␈αthis␈αmode
␈↓ α_␈↓␈↓ αhand␈α∩prompt␈α∩for␈α∩a␈α∩new␈α∩command.␈α∪ If␈α∩you␈α∩want␈α∩the␈α∩stepper␈α∩to␈α∩wait␈α∪for␈α∩a
␈↓ α_␈↓␈↓ αhcommand after each form, you can use the ␈↓αd␈↓ command.
␈↓ α_␈↓␈↓ αhCommands␈α∞␈↓αa␈α∂ad␈α∞(a␈α∞-)␈α∂c␈↓␈α∞and␈α∞␈↓αcc␈↓␈α∂pause␈α∞after␈α∞each␈α∂new␈α∞form␈α∞is␈α∂displayed␈α∞if
␈↓ α_␈↓␈↓ αh␈↓α%%ac-sleep␈↓ is non-␈↓αnil␈↓. Its value is used as the sleep time in seconds.
␈↓ α_␈↓␈↓αad␈↓␈α∪ (all␈α∪down)␈α∪Automatically␈α∪displays␈α∪all␈α∪forms␈α∪and␈α∪values␈α∪encountered␈α∪by␈α∩the
␈↓ α_␈↓␈↓ αhstepper␈α∞in␈α∞evaluating␈α
the␈α∞current␈α∞form␈α
(i.e.␈α∞at␈α∞deeper␈α
levels).␈α∞ Typing␈α∞a␈α
space
␈↓ α_␈↓␈↓ αhprior␈αto␈αcompletion␈αwill␈αcause␈αthe␈αstepper␈αto␈αleave␈αthis␈αmode␈αand␈αprompt␈αfor␈αa
␈↓ α_␈↓␈↓ αhnew␈αcommand.␈α (Also␈αsee␈α␈↓αd␈↓.)␈α Sleeps␈α
after␈αeach␈αform,␈αas␈αdescribed␈αunder␈α
the␈α␈↓αa␈↓
␈↓ α_␈↓␈↓ αhcommand.
␈↓ α_␈↓␈↓α(a␈α␈↓↓lev␈↓α)␈↓␈α Automatically␈αdisplays␈αall␈αforms␈αand␈αvalues␈αat␈αthe␈αindicated␈αlevel␈αand␈αlower
␈↓ α_␈↓␈↓ αh(deeper)␈αlevels,␈αturning␈αitself␈αo≥␈αwhen␈αevaluation␈αpops␈αto␈αa␈αlevel␈αwith␈αa␈αsmaller
␈↓ α_␈↓␈↓ αhlevel␈α∂number.␈α∂ Typing␈α∂a␈α∂space␈α∂prior␈α∞to␈α∂completion␈α∂will␈α∂cause␈α∂the␈α∂stepper␈α∞to
␈↓ α_␈↓␈↓ αhleave␈α∞this␈α∞mode␈α∞and␈α∂prompt␈α∞for␈α∞a␈α∞new␈α∂command.␈α∞ (Also␈α∞see␈α∞␈↓αd␈↓.)␈α∂ Sleeps␈α∞after
␈↓ α_␈↓␈↓ αheach form, as described under the ␈↓αa␈↓ command.
␈↓ α_␈↓␈↓αb␈↓␈α
Sets␈α
a␈α
breakpoint␈α
to␈α
occur␈α
after␈α
evaluation␈α
of␈α
the␈α
current␈α
form.␈α
At␈α
the␈α
break,␈α
the
␈↓ α_␈↓␈↓ αhvalue␈αto␈α
be␈αreturned␈α
is␈αthe␈α
value␈αof␈α
␈↓α%%value␈↓,␈αand␈α
may␈αbe␈α
changed␈αby␈α
␈↓αsetq␈↓'ing
␈↓ α_␈↓␈↓ αhthis␈αvariable.␈α The␈αform␈αthat␈αyielded␈αthis␈αvalue␈αis␈αthe␈αvalue␈αof␈α
␈↓α%%form␈↓.␈α Type
␈↓ α_␈↓␈↓ αh␈↓α$p␈↓␈α⊂to␈α⊂proceed␈α⊂from␈α⊂the␈α⊂breakpoint.␈α⊂ If␈α⊂you␈α⊂prefer␈α⊂the␈α⊂that␈α⊂the␈α⊂system␈α⊂wait
␈↓ α_␈↓␈↓ αhrather␈α∞than␈α∞break␈α
see␈α∞the␈α∞␈↓αwtif␈↓␈α
command.␈α∞ (␈↓αb␈↓␈α∞operates␈α
by␈α∞adding␈α∞the␈α
current
␈↓ α_␈↓␈↓ αhhooklevel␈α∂to␈α∞␈↓α%%breaklist␈↓.)␈α∂ You␈α∞can␈α∂get␈α∞automatic␈α∂breaking␈α∞at␈α∂all␈α∂levels␈α∞by
␈↓ α_␈↓␈↓ αhusing␈α⊗␈↓α(retcond␈α↔t)␈↓␈α⊗or␈α↔conditional␈α⊗breaking␈α⊗as␈α↔described␈α⊗below␈α↔for␈α⊗the
␈↓ α_␈↓␈↓ αh␈↓α(retcond ...)␈↓ command.
␈↓ α_␈↓Page 3-34␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αc␈↓␈α∂ (current)␈α∂Automatically␈α∂displays␈α∂all␈α∂forms␈α∂and␈α∂values␈α∂at␈α∂just␈α∂the␈α∂current␈α∂level.
␈↓ α_␈↓␈↓ αhTyping␈α
a␈α
space␈α
at␈α
any␈α
time␈α
during␈α
the␈α
display␈α
will␈α
cause␈α
the␈α
stepper␈α
to␈αleave
␈↓ α_␈↓␈↓ αhthis␈α
mode␈αand␈α
prompt␈α
for␈αa␈α
new␈αcommand.␈α
The␈α
stepper␈αdoes␈α
not␈α
inspect␈αthe
␈↓ α_␈↓␈↓ αhforms␈αof␈αlower␈αlevels␈α-␈αthus␈αif␈αa␈α
condition␈αis␈αto␈αbe␈αtested␈αfor␈αat␈αthese␈αlevels,␈α
use
␈↓ α_␈↓␈↓ αh␈↓αcc␈↓. Sleeps after each form, as described under the ␈↓αa␈↓ command.
␈↓ α_␈↓␈↓αcc␈↓ Like ␈↓αc␈↓, but inspects the lower levels.
␈↓ α_␈↓␈↓αctog␈↓␈α Flips␈αthe␈α␈↓α%%condnotallow␈↓␈αtoggle␈αwhich␈αis␈αinitially␈α␈↓αt␈↓,␈αmeaning␈αdo␈αnot␈αallow␈α␈↓αc␈↓,
␈↓ α_␈↓␈↓ αh␈↓αm␈↓,␈α␈↓αn␈↓,␈αor␈α␈↓αu␈↓␈αcommands␈αif␈αa␈α
condition␈αis␈αbeing␈αtested␈αfor.␈α ␈↓αnil␈↓␈αmeans␈α
allow␈αthese
␈↓ α_␈↓␈↓ αhanyway.
␈↓ α_␈↓␈↓α(cond␈α∩...)␈↓␈α∩ Tests␈α⊃for␈α∩conditions␈α∩prior␈α⊃to␈α∩evaluation␈α∩of␈α⊃each␈α∩future␈α∩form.␈α⊃ For
␈↓ α_␈↓␈↓ αhpattern␈α∂matching␈α∞against␈α∂the␈α∂form␈α∞using␈α∂the␈α∂␈↓αmatchf␈↓␈α∞function␈α∂and␈α∂for␈α∞other
␈↓ α_␈↓␈↓ αhinformation see the description of ␈↓α(cond ...)␈↓ above.
␈↓ α_␈↓special tests for ␈↓α(cond ...)␈↓ :
␈↓ α_␈↓␈↓ αhTo␈α∞aid␈α
the␈α∞speci≡cation␈α
of␈α∞common␈α
tests,␈α∞the␈α
following␈α∞"∨ags"␈α
are␈α∞provided␈α
-
␈↓ α_␈↓␈↓ αhthe␈αsame␈αe≥ects␈αcould␈αbe␈αobtained␈αby␈αinspecting␈α␈↓α%%form␈↓␈αin␈αyour␈αown␈αpredicate
␈↓ α_␈↓␈↓ αhgiven␈αto␈α
␈↓αcond␈↓.␈α If␈α
the␈α≡rst␈α
argument␈αto␈α
the␈αcond␈α
is␈αfrom␈α
the␈αset␈α
␈↓α(form␈αformq
␈↓ α_␈↓α␈↓ αhbind␈α↔bindq␈α_atomval␈α↔atomvalq␈α_fcn␈α↔fcnq␈α↔and␈α_andq)␈↓␈α↔then␈α_the␈α↔second
␈↓ α_␈↓␈↓ αhargument␈αis␈αused␈αto␈αderive␈αa␈αtest.␈α This␈αprocess␈αis␈αrepeated␈αwith␈αthe␈αremaining
␈↓ α_␈↓␈↓ αharguments,␈αif␈αany.␈α The␈αresulting␈αtests,␈αtogether␈αwith␈αany␈αremaining␈αarguments
␈↓ α_␈↓␈↓ αhnot␈α∂satisfying␈α∂this␈α∂process,␈α∂are␈α⊂e≥ectively␈α∂␈↓↓or␈↓'ed␈α∂together␈α∂to␈α∂derive␈α⊂the␈α∂overall
␈↓ α_␈↓␈↓ αhcondition␈α∞(except␈α∞for␈α∂the␈α∞␈↓αand␈α∞andq␈α∞␈↓↓∨ag␈↓␈α∂special␈α∞tests␈α∞which␈α∞are␈α∂␈↓↓and␈↓'ed).␈α∞ The
␈↓ α_␈↓␈↓ αharguments␈α∩are␈α∪not␈α∩evaluated␈α∩when␈α∪typed␈α∩but␈α∩are␈α∪evaluated␈α∩each␈α∪time␈α∩the
␈↓ α_␈↓␈↓ αhcondition is tested. These ∨ags each may be used more than once.
␈↓ α_␈↓␈↓ αhThe meanings of these ∨ags are:
␈↓ α_␈↓␈↓ αH␈↓αandq␈↓␈α∞ The␈α∞next␈α∂argument␈α∞is␈α∞␈↓↓and␈↓'ed␈α∂with␈α∞the␈α∞remaining␈α∂tests,␈α∞and␈α∞must␈α∂yield␈α∞a
␈↓ α_␈↓␈↓ αHnon-␈↓αnil␈↓␈αvalue␈αfor␈αthe␈αremainder␈αof␈αthe␈αcondition␈αto␈αsucceed.␈α (See␈αthe␈αcomments
␈↓ α_␈↓␈↓ αHfor␈α⊂␈↓αcond␈↓␈α⊂in␈α⊂the␈α⊂"complete␈α⊂list␈α⊂of␈α⊂commands"␈α⊂below␈α⊂regarding␈α⊂the␈α⊂use␈α⊃of␈α⊂side
␈↓ α_␈↓␈↓ αHe≥ects)
␈↓ α_␈↓␈↓ αH␈↓αatomvalq␈↓␈α⊃ The␈α∩next␈α⊃argument␈α⊃should␈α∩be␈α⊃a␈α∩list␈α⊃of␈α⊃two␈α∩elements,␈α⊃the␈α∩≡rst␈α⊃an
␈↓ α_␈↓␈↓ αH(unquoted)␈αname␈α
of␈αan␈α
atom,␈αand␈α
the␈αsecond␈α
the␈αvalue␈α
of␈αthis␈α
atom␈αfor␈α
the␈αtest␈α
to
␈↓ α_␈↓␈↓ αHsucceed.
␈↓ α_␈↓␈↓ αH␈↓αbindq␈↓␈α
Watch␈αfor␈α
the␈αfollowing␈α
(unquoted)␈αatomic␈α
symbol␈αto␈α
be␈αbound␈α
in␈αa␈α
␈↓αprog␈↓,
␈↓ α_␈↓␈↓ αHor␈α∂in␈α∂either␈α∂type␈α∞of␈α∂␈↓αdo␈↓,␈α∂or␈α∂an␈α∂explicitly␈α∞evaluated␈α∂␈↓αlambda␈↓␈α∂(as␈α∂distinct␈α∂from␈α∞an
␈↓ α_␈↓␈↓ αHapplied ␈↓αlambda␈↓ or function call).
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ ⎇Page 3-35
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αH␈↓αfcnq␈↓␈α
Watch␈α
for␈α
the␈αfollowing␈α
(unquoted)␈α
function␈α
name␈αto␈α
be␈α
seen␈α
by␈α
␈↓αeval␈↓␈αas
␈↓ α_␈↓␈↓ αHthe␈α∂car␈α∞of␈α∂the␈α∂form␈α∞about␈α∂to␈α∂be␈α∞evaluated.␈α∂ (This␈α∂cannot␈α∞check␈α∂for␈α∂applied␈α∞or
␈↓ α_␈↓␈↓ αHmapped function calls).
␈↓ α_␈↓␈↓ αH␈↓αformq␈↓␈α The␈αfollowing␈α(unquoted)␈αS-expression␈αis␈αto␈αbe␈αwatched␈αfor.␈α E.g.␈αused␈αto
␈↓ α_␈↓␈↓ αHcheck when a particular variable is about to be evaluated.
␈↓ α_␈↓␈↓ βHThese␈α
evaluate␈αtheir␈α
argument␈αeach␈α
time␈αthe␈α
condition␈αis␈α
tested␈αin␈α
order␈↓ α8␈↓␈↓αand␈↓
␈↓ α_␈↓␈↓ βHto␈α∂get␈α∂the␈α∂desired␈α∂S-expression␈α∂or␈α∂atom␈α∂name,␈α∂and␈α∂then␈α∂perform␈α∂like␈↓ α8␈↓␈↓αbind␈↓
␈↓ α_␈↓␈↓ βHtheir␈α⊗"q"␈α⊗counterparts.␈α⊗ These␈α⊗are␈α⊗particularly␈α⊗useful␈α⊗if␈α↔the␈α⊗∨ag's␈↓ α8␈↓␈↓αfcn␈↓
␈↓ α_␈↓␈↓ βHargument␈α∪is␈α∀the␈α∪value␈α∀of␈α∪a␈α∪variable.␈α∀ (Be␈α∪sure␈α∀not␈α∪to␈α∀change␈α∪the␈↓ α8␈↓␈↓αform␈↓
␈↓ α_␈↓␈↓ βHvariable's value accidentally while the condition remains in e≥ect.)␈↓ α8␈↓␈↓αatomval␈↓
␈↓ α_␈↓␈↓ αxAs␈α⊃a␈α⊂simple␈α⊃example,␈α⊂␈↓α(cond␈α⊃fcnq␈α⊂rplacd)␈↓␈α⊃will␈α⊂check␈α⊃and␈α⊂stop␈α⊃when␈α⊂the
␈↓ α_␈↓␈↓ αxfunction␈α␈↓αrplacd␈↓␈αis␈αabout␈αto␈αbe␈αused␈α(i.e.␈αwhen␈αit␈αis␈αthe␈αthe␈αcar␈αof␈αthe␈αform␈αto
␈↓ α_␈↓␈↓ αxbe evaluated).
␈↓ α_␈↓␈↓ αhThe␈α
commands␈α␈↓αc␈↓,␈α
␈↓αm␈↓,␈α␈↓αn␈↓,␈α
and␈α␈↓αu␈↓␈α
do␈αnot␈α
inspect␈αall␈α
levels,␈αand␈α
thus␈α
the␈αcondition
␈↓ α_␈↓␈↓ αhcannot␈α
be␈α
tested␈αfor␈α
at␈α
these␈αlevels.␈α
You␈α
can␈αuse␈α
␈↓αcc␈↓,␈α
␈↓αnn␈↓,␈α␈↓αmm␈↓,␈α
or␈α
␈↓αuu␈↓␈α
instead,␈αor
␈↓ α_␈↓␈↓ αhuse␈α⊗the␈α⊗␈↓αctog␈↓␈α⊗command.␈α⊗ Naturally,␈α∃condition␈α⊗testing␈α⊗slows␈α⊗the␈α⊗speed␈α∃of
␈↓ α_␈↓␈↓ αhexecution␈αat␈α
levels␈αthat␈αare␈α
inspected␈αby␈αthe␈α
stepper␈αbut␈αwhich␈α
you␈αdo␈αnot␈α
have
␈↓ α_␈↓␈↓ αhdisplayed.
␈↓ α_␈↓␈↓ αhIf␈α⊂you␈α⊂choose␈α⊂to,␈α⊂you␈α⊃can␈α⊂have␈α⊂your␈α⊂predicates␈α⊂produce␈α⊂side-e≥ects␈α⊃such␈α⊂as
␈↓ α_␈↓␈↓ αhrecording␈αinformation␈αof␈αvalue␈αto␈αyou␈αor␈αsetting␈αstates␈αfor␈αuse␈αby␈αthe␈αcondition
␈↓ α_␈↓␈↓ αhlater.␈α
You␈α∞can␈α
use␈α∞the␈α
␈↓αand,␈α∞andq␈↓␈α
∨ags␈α∞(more␈α
than␈α∞once␈α
if␈α∞you␈α
like)␈α∞to␈α
have
␈↓ α_␈↓␈↓ αhthe␈α
expressions␈α
executed␈α
even␈α
upon␈α
success,␈α
so␈α
long␈α
as␈α
these␈α
∨ags␈α
appear␈α
≡rst␈α
in
␈↓ α_␈↓␈↓ αhthe␈αcondition.␈α Other␈αconditions␈αare␈αevaluated␈αin␈αthe␈αorder␈αof␈αappearance␈αuntil
␈↓ α_␈↓␈↓ αhthe ≡rst success is found.
␈↓ α_␈↓␈↓αd␈↓␈α (down)␈αDisplays␈α
the␈αnext␈αlevel␈α
down␈α(as␈αdescribed␈αabove␈α
also).␈α Note␈αthat␈α
if␈αthe
␈↓ α_␈↓␈↓ αhform␈αis␈αan␈αatom,␈αthe␈α
e≥ect␈αis␈αthe␈αsame␈αas␈α
the␈α␈↓αn␈↓␈αcommand.␈α Hence␈αif␈α
you␈αwant
␈↓ α_␈↓␈↓ αhthe␈αstepper␈α
to␈αdisplay␈αevery␈α
form␈αand␈αvalue,␈α
but␈αto␈αwait␈α
for␈αa␈α
command␈αafter
␈↓ α_␈↓␈↓ αheach form, just keep using the ␈↓αd␈↓ command.
␈↓ α_␈↓␈↓αe␈↓␈α∞ (eval)␈α∞Can␈α∞be␈α∂used␈α∞to␈α∞evaluate␈α∞an␈α∞arbitrary␈α∂S-expression.␈α∞ It␈α∞starts␈α∞a␈α∂new␈α∞line,
␈↓ α_␈↓␈↓ αhwaits␈αfor␈αyou␈αto␈αtype␈αthe␈αexpression,␈αevaluates␈αit␈αwithin␈αan␈α␈↓αerrset␈↓,␈αand␈αprints
␈↓ α_␈↓␈↓ αhthe␈αresult.␈α Comparable␈αto␈αjust␈αtyping␈αthe␈αexpression␈αor␈αatom␈αafter␈αthe␈α␈↓α//␈↓,␈αbut
␈↓ α_␈↓␈↓ αhcannot be confused with a command, and the format is nicer.
␈↓ α_␈↓␈↓α(=␈α␈↓↓S-exp␈↓α)␈↓␈α Replaces␈αthe␈αcurrent␈αform␈αwith␈αthe␈αgiven␈αS-expression,␈αand␈αthen␈αprompts
␈↓ α_␈↓␈↓ αhfor␈α∞another␈α∞command,␈α∞as␈α∞described␈α∞above.␈α∞ If␈α∞two␈α∞arguments␈α∞are␈α∞given,␈α
then
␈↓ α_␈↓␈↓ αhthis␈α⊃expression␈α⊃will␈α⊂not␈α⊃be␈α⊃treated␈α⊂as␈α⊃a␈α⊃stepper␈α⊂command,␈α⊃rather␈α⊃it␈α⊃will␈α⊂be
␈↓ α_␈↓␈↓ αhevaluated (see comments at top of this section).
␈↓ α_␈↓Page 3-36␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αh␈↓␈α Control-H␈αbreak␈αis␈αexecuted.␈α The␈αcurrent␈αform␈αis␈αredisplayed␈αwhen␈α␈↓α$p␈↓␈αis␈αtyped.
␈↓ α_␈↓␈↓ αhThe␈α
form␈α
about␈αto␈α
be␈α
evaluated␈αis␈α
the␈α
value␈α
of␈α␈↓α%%form␈↓.␈α
Within␈α
the␈αbreak,␈α
one
␈↓ α_␈↓␈↓ αhcan inspect the values of variables, etc., and even reapply ␈↓αmev␈↓ to any form.
␈↓ α_␈↓␈↓αk␈↓␈α
(kill)␈α Does␈α
not␈αevaluate␈α
the␈αcurrent␈α
form␈αnor␈α
display␈αany␈α
value.␈αThis␈α
is␈α
good␈αfor
␈↓ α_␈↓␈↓ αhavoiding␈αside␈αe≥ects␈αif␈αrestepping␈αthrough␈αa␈αprogram␈αagain.␈α Equivalent␈αto␈α␈↓α(=
␈↓ α_␈↓α␈↓ αhnil)␈↓ followed by ␈↓αm␈↓ command.
␈↓ α_␈↓␈↓αlr␈↓␈α(last␈α
result)␈αA␈α
complete␈αrather␈αthan␈α
abbreviated␈αprintout␈α
of␈αthe␈α
last␈αresult␈αis␈α
given.
␈↓ α_␈↓␈↓ αh(See ␈↓α(p - -)␈↓ for further information.)
␈↓ α_␈↓␈↓αm␈↓␈α
Next,␈α
like␈α␈↓αn␈↓␈α
but␈α
the␈α
result␈αof␈α
the␈α
current␈αform␈α
is␈α
not␈α
displayed.␈α If␈α
a␈α
condition␈αis␈α
to
␈↓ α_␈↓␈↓ αhbe tested for at lower levels, use ␈↓αmm␈↓.
␈↓ α_␈↓␈↓α(matchf␈α⊂...)␈↓␈α⊂ is␈α⊂equivalent␈α⊂to␈α⊂␈↓α(cond␈α⊂(matchf␈α⊂...))␈↓,␈α⊂see␈α⊂the␈α⊂the␈α⊃description␈α⊂of
␈↓ α_␈↓␈↓ αh␈↓α(cond ...)␈↓ above.
␈↓ α_␈↓␈↓αmm␈↓ Next, like ␈↓αnn␈↓ but the result of the current form is not displayed.
␈↓ α_␈↓␈↓αn␈↓␈α∂ (next)␈α∞Displays␈α∂the␈α∞value␈α∂of␈α∂the␈α∞current␈α∂form␈α∞and␈α∂displays␈α∞the␈α∂next␈α∂form,␈α∞then
␈↓ α_␈↓␈↓ αhawaits␈αthe␈αnext␈αcommand.␈α
Does␈αnot␈αinspect␈αthe␈α
lower␈αlevels.␈α If␈αa␈α
condition␈αis
␈↓ α_␈↓␈↓ αhto be tested for at lower levels, use ␈↓αnn␈↓ instead.
␈↓ α_␈↓␈↓αnn␈↓ Like n but inspects the lower levels.
␈↓ α_␈↓␈↓αo␈↓␈α (old)␈α
Does␈α␈↓α(mev␈α'␈↓↓last␈α
form␈↓α)␈↓.␈α This␈αis␈α
useful␈αfor␈αseeing␈α
how␈αa␈αform␈α
produced␈αan
␈↓ α_␈↓␈↓ αhunexpected␈α⊂value␈α∂when␈α⊂you␈α∂went␈α⊂over␈α∂it␈α⊂with␈α∂␈↓αn␈↓␈α⊂or␈α∂␈↓αnn␈↓.␈α⊂ If␈α⊂reevaluating␈α∂the
␈↓ α_␈↓␈↓ αhform␈α∩can␈α∩produce␈α∪side␈α∩e≥ects␈α∩be␈α∪careful.␈α∩ Can␈α∩be␈α∪exited␈α∩from␈α∩by␈α∪the␈α∩␈↓αxx␈↓
␈↓ α_␈↓␈↓ αhcommand. (The old form is the value of ␈↓α%%oldform␈↓.)
␈↓ α_␈↓␈↓αol␈↓␈α∩ (old,␈α∩at␈α⊃current␈α∩level)␈α∩ Does␈α∩␈↓α(mev␈α⊃'␈↓↓last␈α∩form␈α∩at␈α⊃this␈α∩level␈↓α)␈↓.␈α∩ Behaves␈α∩like␈α⊃␈↓αo␈↓.
␈↓ α_␈↓␈↓ αhUseful␈αto␈αsee␈αthe␈αform␈α(at␈αthis␈α
level)␈αwhich␈αproduced␈αthe␈αcurrent␈αvalue␈α-␈α
rather
␈↓ α_␈↓␈↓ αhthan␈αthe␈αlast␈αform␈αprinted␈αout,␈αas␈α␈↓αo␈↓␈αwould␈αyield.␈α (The␈αold␈αform␈αused␈αhere␈αcan
␈↓ α_␈↓␈↓ αhbe obtained by (get ␈↓α%%hooklevel 'oldform)␈↓.)
␈↓ α_␈↓␈↓αp␈↓␈α (print)␈α Redisplays␈αthe␈αcurrent␈αform.␈α This␈αis␈αuseful␈αif␈αyou␈αwish␈αto␈αclear␈αthe␈α
screen
␈↓ α_␈↓␈↓ αh≡rst␈αwith␈αcontrol-L.␈α Gives␈αtypical␈αabbreviated␈αdisplay␈α(see␈α␈↓α(p␈α-␈α-)␈↓),␈αexcept␈αhas
␈↓ α_␈↓␈↓ αhsomewhat␈αdi≥erent␈αe≥ect␈αif␈αin␈αdisplay␈αmode␈α(see␈α␈↓αs␈↓␈αcommand).␈α (For␈αhackers␈αof
␈↓ α_␈↓␈↓ αhspecial␈αdata␈αstructures,␈αe.g.␈α
"owl",␈αprinting␈αwill␈αbe␈α
done␈αwith␈αthe␈αfunction␈α
which
␈↓ α_␈↓␈↓ αhis␈αthe␈αvalue␈αof␈αthe␈αatom␈α␈↓αprin1␈↓␈αif␈αnon-␈↓αnil␈↓␈α-␈αas␈αalso␈αapplies␈αto␈αtop-level␈αin␈αlisp.
␈↓ α_␈↓␈↓ αhThis␈α
value␈α
of␈α
␈↓αprin1␈↓␈α
is␈α
checked␈αonly␈α
in␈α
the␈α
␈↓αmev␈↓␈α
function.␈α
Moreover,␈αunless␈α
you
␈↓ α_␈↓␈↓ αhrequest␈α
lisp␈α∞not␈α
to␈α
"snap␈α∞links"␈α
in␈α
compiled␈α∞code,␈α
you␈α
may␈α∞have␈α
to␈α∞reload␈α
the
␈↓ α_␈↓␈↓ αhstepper after changing ␈↓αprin1␈↓.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ ⎇Page 3-37
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αpp␈↓ (full print) Gives a complete printout of the current form.
␈↓ α_␈↓␈↓αppp␈↓␈α(even␈αbetter␈αprintout)␈α Pretty-prints␈αthe␈αcurrent␈αform␈αusing␈αthe␈α␈↓αsprint␈↓␈αfunction.
␈↓ α_␈↓␈↓ αhUses a lot of screen in general, and so will turn on pagepause for you.
␈↓ α_␈↓␈↓α(p␈α∞-␈α∞-)␈↓␈α∞Resets␈α∞the␈α∞parameters␈α∞for␈α∞the␈α∞abbreviated␈α∞printout␈α∞used␈α∞for␈α∞results,␈α
forms
␈↓ α_␈↓␈↓ αhand␈α∂the␈α∂␈↓αp␈↓␈α∂command.␈α⊂ The␈α∂≡rst␈α∂parameter␈α∂is␈α⊂the␈α∂prinlevel,␈α∂the␈α∂second␈α⊂is␈α∂the
␈↓ α_␈↓␈↓ αhprinlength;␈α∩both␈α∩must␈α⊃be␈α∩given.␈α∩ If␈α⊃␈↓αnil␈↓␈α∩is␈α∩given␈α⊃instead␈α∩of␈α∩a␈α∩number␈α⊃no
␈↓ α_␈↓␈↓ αhabbreviating␈α∞is␈α∂done␈α∞with␈α∞respect␈α∂to␈α∞that␈α∞parameter;␈α∂thus␈α∞␈↓α(p␈α∞nil␈α∂nil)␈↓␈α∞turns
␈↓ α_␈↓␈↓ αho≥ abbreviation. (The current settings are the value of ␈↓α%%hookprin␈↓.)
␈↓ α_␈↓␈↓αq␈↓␈α⊃ (quit)␈α⊃Exits␈α⊃from␈α⊃the␈α⊃stepper.␈α⊃ Previously␈α⊃requested␈α⊃breaks␈α⊃and␈α∩conditions␈α⊃are
␈↓ α_␈↓␈↓ αhdisabled,␈α∂and␈α⊂any␈α∂non-␈↓αnil␈↓␈α∂conditions␈α⊂are␈α∂saved␈α∂on␈α⊂the␈α∂␈↓αold␈↓␈α∂property␈α⊂of␈α∂the
␈↓ α_␈↓␈↓ αhconditon name. (Control-G also exits as usual.)
␈↓ α_␈↓␈↓αs␈↓␈α∞(show␈α∞or␈α∂display␈α∞mode)␈α∞ For␈α∂datapoints␈α∞and␈α∞other␈α∂display␈α∞terminals,␈α∞this␈α∂gives␈α∞a
␈↓ α_␈↓␈↓ αhnice␈α∩easily␈α∩read␈α⊃output␈α∩of␈α∩selected␈α⊃levels␈α∩that␈α∩constitute␈α⊃the␈α∩context␈α∩of␈α⊃the
␈↓ α_␈↓␈↓ αhcurrent␈α∂evaluation.␈α∂ Speci≡cally,␈α∂it␈α∂selects␈α∂the␈α∂current␈α∂level␈α∂for␈α∂sprinting␈α⊂as␈α∂a
␈↓ α_␈↓␈↓ αh"header",␈α∞and␈α∞as␈α∞you␈α∞go␈α∞deeper,␈α∞the␈α∞local␈α∞context␈α∞is␈α∞abbreviate-printed␈α∞under
␈↓ α_␈↓␈↓ αhthis␈αheader,␈αand␈α
the␈αcurrent␈αoutput␈αwill␈α
be␈αsprinted.␈α ␈↓αs␈↓␈αmay␈α
be␈αused␈αas␈αoften␈α
as
␈↓ α_␈↓␈↓ αhyou␈α↔like.␈α⊗ Headers␈α↔will␈α⊗automatically␈α↔be␈α⊗popped␈α↔when␈α⊗you␈α↔return.␈α⊗ All
␈↓ α_␈↓␈↓ αhsprinting␈α∞is␈α∞done␈α∞with␈α∞pagepause␈α∞on.␈α∞ If␈α∞control-X␈α∞is␈α∞typed␈α∞during␈α∞sprinting,
␈↓ α_␈↓␈↓ αhthat␈α
expression␈α
will␈α∞be␈α
redisplayed␈α
using␈α
abbreviated-printing␈α∞instead.␈α
When
␈↓ α_␈↓␈↓ αhin␈α
this␈α
display␈α∞mode,␈α
the␈α
␈↓αp␈↓␈α∞command␈α
will␈α
clear␈α
the␈α∞screen␈α
from␈α
the␈α∞last␈α
form
␈↓ α_␈↓␈↓ αhdown,␈α⊂unless␈α∂preceeded␈α⊂by␈α⊂control-L␈α∂(or␈α⊂if␈α∂wrap-around␈α⊂occurred),␈α⊂in␈α∂which
␈↓ α_␈↓␈↓ αhcase␈α
the␈αscreen␈α
is␈αfully␈α
redisplayed.␈α Also␈α
see␈α␈↓α(s␈α
␈↓↓arg␈↓α)␈↓␈αfor␈α
more␈αinformation␈α
and
␈↓ α_␈↓␈↓ αhoptions.
␈↓ α_␈↓␈↓α(s␈α∂␈↓↓arg␈↓α)␈↓␈α⊂ If␈α∂␈↓↓arg␈↓␈α∂is␈α⊂positive,␈α∂this␈α⊂selects␈α∂the␈α∂form␈α⊂at␈α∂that␈α∂level␈α⊂as␈α∂the␈α⊂"header"␈α∂for
␈↓ α_␈↓␈↓ αh␈↓αs␈↓(how)␈αmode.␈α If␈αnegative,␈αit␈αuses␈αthe␈αform␈αat␈α␈↓↓arg␈↓␈αlevels␈αabove␈αthe␈αcurrent␈αone.
␈↓ α_␈↓␈↓ αhIf␈α␈↓↓arg␈↓␈αis␈α␈↓αnil␈↓,␈αdisplay␈αmode␈αis␈αturned␈αo≥␈α(headers␈αare␈αremembered␈αthough).␈α ␈↓α(s
␈↓ α_␈↓α␈↓ αht)␈↓␈αjust␈αturns␈αdisplay␈αmode␈αon␈αif␈αcurrently␈αo≥␈αusing␈αthe␈αpreviously␈αremembered
␈↓ α_␈↓␈↓ αhheaders␈αif␈αstill␈αapplicable;␈αbut␈αif␈αit␈αis␈αalready␈αon,␈αthis␈αpops␈αthe␈αstack␈αof␈αheaders
␈↓ α_␈↓␈↓ αhby␈α
one␈α(normally␈α
headers␈α
are␈αautomatically␈α
popped␈α
when␈αthe␈α
level␈α
is␈αreturned
␈↓ α_␈↓␈↓ αhfrom).␈α
All␈αsprinting␈α
is␈αdone␈α
with␈αpagepause␈α
on.␈α If␈α
control-X␈αis␈α
typed␈αduring
␈↓ α_␈↓␈↓ αhsprinting,␈α_that␈α_expression␈α_will␈α_be␈α_redisplayed␈α→using␈α_abbreviated-printing
␈↓ α_␈↓␈↓ αhinstead. Also see the ␈↓αsn␈↓ command.
␈↓ α_␈↓␈↓ αhSeveral␈αparameters␈αare␈αuser␈αsettable␈αfrom␈αtheir␈αdefaults.␈α ␈↓α%%lowerdisplay␈↓␈αand
␈↓ α_␈↓␈↓ αh␈↓α%%lowerdisplay-min␈↓␈αcontrol␈αthe␈αmaximum␈αand␈αminimum␈αnumber␈αof␈αlevels␈αto
␈↓ α_␈↓␈↓ αhdisplay␈α∂below␈α∞the␈α∂header␈α∞(defaults␈α∂of␈α∞5␈α∂and␈α∞2).␈α∂ This␈α∞is␈α∂done␈α∂in␈α∞abbreviate-
␈↓ α_␈↓␈↓ αhprinted␈α↔form␈α↔using␈α↔␈↓α%%shortprin␈↓␈α↔which␈α_is␈α↔a␈α↔list␈α↔of␈α↔the␈α_prinlevel␈α↔and
␈↓ α_␈↓Page 3-38␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αhprinlength␈α_(defaults␈α↔3␈α_and␈α_3).␈α↔ Sprinting␈α_of␈α_forms␈α↔and␈α_results␈α_will␈α↔be
␈↓ α_␈↓␈↓ αhabbreviate-sprinted␈α
by␈α
the␈α␈↓αmsprint␈↓␈α
function␈α
if␈αthe␈α
␈↓α∨atsize␈↓␈α
of␈αthe␈α
expression
␈↓ α_␈↓␈↓ αhexceeds␈α⊂␈↓α%%∨atsize-max␈↓␈α⊂(default␈α⊂about␈α∂450).␈α⊂ The␈α⊂prinlevel␈α⊂and␈α∂prinlength
␈↓ α_␈↓␈↓ αhfor␈α∞the␈α∞latter␈α∞are␈α∞the␈α∞list␈α∞which␈α∞is␈α∞the␈α∞value␈α∞of␈α∞␈↓α%%sprintabbr␈↓␈α∞(default␈α∞is␈α∞␈↓α(7
␈↓ α_␈↓α␈↓ αh8)␈↓).␈α⊂ If␈α⊂␈↓α%%∨atsize␈↓␈α⊂is␈α⊂␈↓αnil␈↓,␈α⊂full␈α⊂sprinting␈α⊂will␈α⊂always␈α⊂be␈α⊂used;␈α⊂(if␈α⊂negative,
␈↓ α_␈↓␈↓ αhabbreviate-sprinting␈α∃will␈α∃always␈α∃be␈α∃used␈α∃so␈α∃that␈α∃in≡nite␈α∃printing␈α∀circular
␈↓ α_␈↓␈↓ αhstructures␈α⊂will␈α⊂sprint␈α⊃and␈α⊂abbreviate-print␈α⊂≡nitely.␈α⊃ To␈α⊂turn␈α⊂o≥␈α⊃sprinting␈α⊂of
␈↓ α_␈↓␈↓ αhresults␈α
␈↓αsetq␈↓␈α
␈↓α%%result-sprint␈↓␈α
to␈α
␈↓αnil␈↓␈α
(default␈α
␈↓αt␈↓).␈α
If␈α
␈↓α%%mdistitle␈↓␈α
is␈α
neither
␈↓ α_␈↓␈↓ αh␈↓αnil␈↓␈αnor␈αa␈αnumber,␈αit␈αwill␈αbe␈αevaluated␈αjust␈αafter␈αthe␈αscreen␈αis␈αcleared,␈αallowing
␈↓ α_␈↓␈↓ αhprinting␈αof␈αa␈αtitle.␈α If␈αit␈αis␈αa␈αnumber,␈αthat␈αnumber␈αof␈αblank␈αlines␈αwill␈αbe␈αleft␈αat
␈↓ α_␈↓␈↓ αhthe␈α
top␈α
of␈α
the␈α
screen␈α
(also␈α
see␈α
␈↓αsviewmsg␈↓␈α
function␈α
below).␈α
If␈α
the␈αpartial␈α
clearing
␈↓ α_␈↓␈↓ αhof␈α∪the␈α∀screen␈α∪bothers␈α∪your␈α∀eyes,␈α∪␈↓αsetq␈↓'ing␈α∪␈↓α%%eyestrain1␈↓␈α∀to␈α∪a␈α∀number␈α∪of
␈↓ α_␈↓␈↓ αhseconds␈α∩(e.g.␈α∩0.5␈α∩to␈α∩2.0)␈α∩will␈α⊃slow␈α∩down␈α∩the␈α∩new␈α∩display␈α∩depending␈α∩on␈α⊃the
␈↓ α_␈↓␈↓ αhnumber of lines cleared.
␈↓ α_␈↓␈↓αsn␈↓␈αJust␈αfor␈α␈↓αs␈↓(how)␈αdisplay␈αmode.␈α It␈αprevents␈αclearing␈αof␈αthe␈αscreen␈α
after␈αprompting
␈↓ α_␈↓␈↓ αhfor␈αanother␈αcommand,␈αbut␈αonly␈αuntil␈αthe␈αnext␈αprompting␈α␈↓α//␈↓␈αafter␈αthat.␈α Useful
␈↓ α_␈↓␈↓ αhif␈αyou␈αwant␈αa␈αresult␈αto␈αremain␈αdisplayed␈αa␈αlittle␈αlonger.␈α If␈αyou␈αwant␈αto␈αprevent
␈↓ α_␈↓␈↓ αhclearing␈αof␈α
the␈αscreen␈α
for␈αmore␈α
than␈αa␈α
couple␈αof␈α
times,␈αuse␈α
␈↓α(s␈αnil)␈↓,␈α
then␈αdo␈α
␈↓α(s
␈↓ α_␈↓α␈↓ αht)␈↓ when you want to resume display mode.
␈↓ α_␈↓␈↓α(retcond␈α∞...)␈↓␈α∞ Tests␈α∞for␈α
conditions␈α∞just␈α∞after␈α∞each␈α
form␈α∞is␈α∞evaluated,␈α∞and␈α
breaks
␈↓ α_␈↓␈↓ αhwhen␈αsuch␈αcondition␈α
is␈αsatis≡ed.␈α At␈α
the␈αbreak,␈αthe␈αvalue␈α
to␈αbe␈αreturned␈α
is␈αthe
␈↓ α_␈↓␈↓ αhvalue␈α
of␈α
␈↓α%%value␈↓,␈α
and␈α
may␈α
be␈αchanged␈α
by␈α
␈↓αsetq␈↓'ing␈α
this␈α
variable.␈α
The␈αform
␈↓ α_␈↓␈↓ αhthat␈α
yielded␈α
this␈α
value␈α∞is␈α
the␈α
value␈α
of␈α
␈↓α%%form␈↓.␈α∞ Type␈α
␈↓α$p␈↓␈α
to␈α
proceed␈α∞from␈α
the
␈↓ α_␈↓␈↓ αhbreakpoint.␈α∃ The␈α∃conditions␈α⊗are␈α∃speci≡ed␈α∃as␈α⊗for␈α∃␈↓α(cond␈α∃...)␈↓.␈α⊗ Note␈α∃that
␈↓ α_␈↓␈↓ αh␈↓α(retcond␈α∞t)␈↓␈α∂will␈α∞give␈α∂you␈α∞a␈α∂break␈α∞as␈α∂each␈α∞level␈α∂is␈α∞popped␈α∂(returned␈α∞from),
␈↓ α_␈↓␈↓ αhincluding␈α∞levels␈α∞above␈α∞the␈α∞one␈α∞where␈α∞the␈α∞request␈α∞was␈α∞made.␈α∂ ␈↓α(retcond␈α∞nil)␈↓
␈↓ α_␈↓␈↓ αhdisables␈αthe␈α
retcond.␈α If␈αyou␈α
prefer␈αwaiting␈αrather␈α
than␈αbreaking␈αsee␈α
the␈α␈↓αwtif␈↓
␈↓ α_␈↓␈↓ αhcommand.
␈↓ α_␈↓␈↓ αhTwo additional ∨ags are available:
␈↓ α_␈↓␈↓ αH␈↓αvalueq␈↓␈α⊂ The␈α⊃test␈α⊂␈↓α(equal␈α⊃%%value␈α⊂␈↓↓next-argument␈↓α)␈↓␈α⊃is␈α⊂performed␈α⊃as␈α⊂if␈α⊃it␈α⊂were
␈↓ α_␈↓␈↓ αH␈↓↓and␈↓'ed with the remaining predicates in the condition.
␈↓ α_␈↓␈↓ αH␈↓αvalue␈↓␈α⊃ Like␈α⊃␈↓αvalueq␈↓␈α∩but␈α⊃the␈α⊃test␈α∩is␈α⊃␈↓α(equal␈α⊃%%value␈α∩(eval␈α⊃␈↓↓next-argument␈↓α))␈↓.
␈↓ α_␈↓␈↓ αHThe␈α
overall␈α
condition␈α
is␈αmaintained␈α
on␈α
the␈α
value␈αof␈α
the␈α
atom␈α
␈↓α%%retcond␈↓,␈αand␈α
the
␈↓ α_␈↓␈↓ αHprevious␈α
non-␈↓αnil␈↓␈α
condition␈α
is␈α
on␈α
the␈α
␈↓αold␈↓␈α
property␈α
of␈α
this␈α
atom.␈α
If␈α
you␈α
want␈α
both
␈↓ α_␈↓␈↓ αH␈↓αcond␈↓␈α⊗and␈α⊗␈↓αretcond␈↓␈α↔conditions␈α⊗to␈α⊗be␈α⊗the␈α↔same␈α⊗you␈α⊗can␈α↔␈↓α(setq␈α⊗%%retcond
␈↓ α_␈↓α␈↓ αH%%cond)␈↓. The ␈↓αvalue␈↓ and ␈↓αvalueq␈↓ predicates will be ignored in a ␈↓α(cond ...)␈↓.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ |Page 3-39
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αu␈↓␈α∞ (up)␈α
Go␈α∞up␈α
to␈α∞next␈α
higher␈α∞level.␈α
Current␈α∞and␈α
lower␈α∞levels␈α
are␈α∞executed␈α
without
␈↓ α_␈↓␈↓ αhdisplay.␈α The␈αlower␈αlevels␈αare␈αnot␈αinspected␈α-␈αthus␈αif␈αa␈αcondition␈αis␈αto␈αbe␈αtested
␈↓ α_␈↓␈↓ αhfor␈αat␈αthese␈αlevels,␈αuse␈α␈↓αuu␈↓.␈α This␈αcan␈αbe␈αused␈αto␈αskip␈αthe␈αdisplay␈αof␈αa␈αfunction's
␈↓ α_␈↓␈↓ αhinternal␈α∀evaluation␈α∃after␈α∀having␈α∃seen␈α∀the␈α∀arguments,␈α∃as␈α∀described␈α∃in␈α∀the
␈↓ α_␈↓␈↓ αhprevious section.
␈↓ α_␈↓␈↓α(u␈α∂␈↓↓num␈↓α)␈↓␈α∞ If␈α∂␈↓↓num␈↓␈α∂is␈α∞positive␈α∂(or␈α∂zero),␈α∞forms␈α∂are␈α∂not␈α∞inspected␈α∂nor␈α∂displayed␈α∞until
␈↓ α_␈↓␈↓ αhthat␈α⊂level␈α∂number␈α⊂is␈α∂reached.␈α⊂ If␈α⊂negative,␈α∂it␈α⊂goes␈α∂up␈α⊂this␈α⊂number␈α∂(absolute
␈↓ α_␈↓␈↓ αhvalue) of levels relative to the current level. Thus ␈↓α(u -1)␈↓ is equivalent to ␈↓αu␈↓ .
␈↓ α_␈↓␈↓αuu␈↓ Like ␈↓αu␈↓, but also inspects lower levels. Use if you have a condition to be tested.
␈↓ α_␈↓␈↓α(uu␈α
␈↓↓num␈↓α)␈↓␈α
Like␈α
␈↓α(u␈α
␈↓↓num␈↓α)␈↓␈α
but␈α
slower.␈α
Use␈α
if␈α
testing␈α
for␈α
a␈α
condition.␈α
Note␈α∞that␈α
␈↓α(uu
␈↓ α_␈↓α␈↓ αh-999)␈↓␈αe≥ectively␈αmeans␈αthat␈αyou␈αwon't␈α
see␈αany␈αlevels␈αunless␈αthe␈αcondition␈α
in␈αa
␈↓ α_␈↓␈↓ αh␈↓αcond␈↓ or ␈↓αretcond␈↓ is satis≡ed.
␈↓ α_␈↓␈↓αwtal␈↓␈α(wait-all)␈α Flips␈αa␈αtoggle␈αwhich␈αwhen␈αon␈αcauses␈αa␈αpause␈αafter␈αthe␈αevaluation␈αof
␈↓ α_␈↓␈↓ αhevery␈α
form,␈α
but␈α
before␈αthat␈α
value␈α
is␈α
returned.␈α The␈α
system␈α
waits␈α
for␈α
an␈αinput
␈↓ α_␈↓␈↓ αhcharacter.␈α⊂ Typing␈α⊂y(es),␈α⊂b(reak),␈α⊂or␈α⊂h␈α⊂(for␈α⊂control-h)␈α⊂followed␈α⊂by␈α⊃space␈α⊂will
␈↓ α_␈↓␈↓ αhcause␈α∂a␈α∂break␈α∂as␈α∂would␈α∂the␈α∂␈↓αb␈↓␈α∂command.␈α∂ Typing␈α∂just␈α∂a␈α∂space,␈α∂or␈α⊂any␈α∂other
␈↓ α_␈↓␈↓ αhcharacter followed by a space, will proceed from the pause. Default is o≥.
␈↓ α_␈↓␈↓αwtif␈↓␈α (wait-if)␈α Flips␈αa␈αtoggle␈αwhich␈αwhen␈αon␈αcauses␈αrequests␈αby␈αthe␈α␈↓αb␈↓␈αand␈α␈↓α(retcond
␈↓ α_␈↓α␈↓ αh...)␈↓␈α∞commands␈α∞to␈α∞result␈α∞in␈α∞a␈α∂pause␈α∞rather␈α∞than␈α∞a␈α∞break.␈α∞ The␈α∞pause␈α∂is␈α∞like
␈↓ α_␈↓␈↓ αhthat␈α⊃of␈α⊂the␈α⊃␈↓αwtal␈↓␈α⊂command,␈α⊃and␈α⊂may␈α⊃be␈α⊂proceeded␈α⊃by␈α⊂a␈α⊃space;␈α⊂or␈α⊃a␈α⊂break
␈↓ α_␈↓␈↓ αhinitiated by typing y, b, or h followed by a space. Default is o≥.
␈↓ α_␈↓␈↓αxx␈↓␈αDoes␈α
a␈αcontrol-X␈α
type␈αof␈α
lisp␈αquit.␈α
(A␈αcontrol-X␈α
typed␈αafter␈α
the␈α␈↓α//␈↓␈α
prompt␈αwill␈α
be
␈↓ α_␈↓␈↓ αhcaught by an ␈↓αerrset␈↓. The ␈↓αxx␈↓ command is executed outside of that ␈↓αerrset␈↓.)
␈↓ α_␈↓The following other facilities exist:
␈↓ α_␈↓␈↓α(gethklevel␈α␈↓↓num␈↓α)␈↓␈α This␈α
function␈αreturns␈αthe␈αS-expression␈α
that␈αis␈αon␈α
the␈αexecution
␈↓ α_␈↓␈↓ αhstack␈α
of␈α
the␈α
stepper␈α
at␈α
the␈α
given␈α
level␈α
number␈α
(see␈α
␈↓αhkshow␈↓).␈α
Can␈α
be␈α
used␈αto␈α
get
␈↓ α_␈↓␈↓ αhan␈α∞unsprinted␈α∞unabbreviated␈α∞display␈α∞of␈α∞the␈α∞form␈α∞or␈α∞to␈α∞record␈α∞or␈α∞process␈α∞the
␈↓ α_␈↓␈↓ αhform as you desire, including reapplication of ␈↓αmev␈↓ to it in the current context.
␈↓ α_␈↓␈↓α(hkshow␈α⊗␈↓↓num␈↓α)␈↓␈α⊗ This␈α⊗function␈α⊗will␈α↔display␈α⊗previous␈α⊗forms␈α⊗which␈α⊗are␈α↔on␈α⊗the
␈↓ α_␈↓␈↓ αhexecution␈α∪stack,␈α∪as␈α∪seen␈α∪by␈α∪the␈α∪stepper␈α∪while␈α∪it␈α∪has␈α∪been␈α∀activated.␈α∪ The
␈↓ α_␈↓␈↓ αhprevious␈α␈↓↓num␈↓␈αof␈αlevels␈αare␈αshown,␈αwith␈αthe␈αcurrent␈αform␈αlast.␈α If␈α
no␈αargument
␈↓ α_␈↓␈↓ αhis␈α
given,␈α∞then␈α
all␈α
levels␈α∞are␈α
shown.␈α
The␈α∞display␈α
is␈α
done␈α∞under␈α
the␈α∞control␈α
of
␈↓ α_␈↓␈↓ αhprinlevel␈α⊃and␈α⊂prinlength␈α⊃which␈α⊂are␈α⊃settable␈α⊂by␈α⊃the␈α⊂␈↓α(p␈α⊃-␈α⊂-)␈↓␈α⊃command.␈α⊂ Of
␈↓ α_␈↓Page 3-40␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αhcourse␈α
this␈αfunction␈α
can␈α
also␈αbe␈α
used␈αas␈α
if␈α
it␈αwere␈α
a␈α
command␈αby␈α
typing␈αit␈α
after
␈↓ α_␈↓␈↓ αhthe prompting ␈↓α//␈↓.
␈↓ α_␈↓␈↓α(hksprint␈α
␈↓↓num␈↓α)␈↓␈α
This␈α
function␈α
will␈α
sprint␈α∞the␈α
form␈α
on␈α
the␈α
level␈α
whose␈α∞number␈α
is
␈↓ α_␈↓␈↓ αhgiven as the argument. Can also be used as a command.
␈↓ α_␈↓␈↓α(hkstart)␈↓␈α
Use␈α
this␈αfunction␈α
to␈α
invoke␈αor␈α
reinvoke␈α
the␈αstepper␈α
from␈α
a␈αbreakpoint␈α
or
␈↓ α_␈↓␈↓ αhfrom␈α
a␈α
program␈α
as␈α
described␈α
above.␈α If␈α
used␈α
within␈α
a␈α
break,␈α
type␈α␈↓α(hkstart)␈↓
␈↓ α_␈↓␈↓ αhby␈αitself␈αrather␈αthan␈α
within␈αanother␈αS-expression␈αor␈α
function,␈αas␈αit␈αhas␈αto␈α
climb
␈↓ α_␈↓␈↓ αhthe␈αstack␈αfrom␈αthe␈αpoint␈αof␈αinvocation.␈α If␈αan␈αargument␈αis␈αgiven␈αto␈αthis␈αfexpr,
␈↓ α_␈↓␈↓ αhit␈α
will␈α
be␈α
evaluated␈α
just␈α
prior␈α
to␈α
establishing␈α
stepping,␈α
with␈α
␈↓α↑w␈↓␈α
bound␈α
to␈α␈↓αnil␈↓,␈α
so
␈↓ α_␈↓␈↓ αhthat you can print out information if called from a program.
␈↓ α_␈↓␈↓ αh(It␈αis␈αpossible␈αfor␈αthe␈αinvocation␈αof␈αthe␈αstepper␈αby␈αthis␈αmethod␈αto␈αhave␈αlimited
␈↓ α_␈↓␈↓ αhscope␈α↔under␈α↔some␈α↔circumstances.␈α_ Such␈α↔a␈α↔boundary␈α↔would␈α↔be␈α_a␈α↔second
␈↓ α_␈↓␈↓ αhbreakpoint␈α∂higher␈α∂on␈α∂the␈α∂stack␈α∞or␈α∂a␈α∂previously␈α∂terminated␈α∂invocation␈α∂of␈α∞the
␈↓ α_␈↓␈↓ αhstepper␈α⊃that␈α⊃is␈α⊃still␈α⊃on␈α⊃the␈α⊃stack.␈α⊃ Also␈α⊃if␈α⊃the␈α⊃program␈α⊃was␈α⊃initially␈α⊃started
␈↓ α_␈↓␈↓ αhwithout␈α⊃␈↓αmev␈↓,␈α⊃and␈α∩stepping␈α⊃is␈α⊃retained␈α⊃thoughout␈α∩the␈α⊃rest␈α⊃of␈α∩the␈α⊃execution,
␈↓ α_␈↓␈↓ αhstepping␈α∞may␈α∂also␈α∞remain␈α∂for␈α∞forms␈α∂typed␈α∞at␈α∂top␈α∞level␈α∂-␈α∞to␈α∂stop␈α∞this␈α∂just␈α∞do
␈↓ α_␈↓␈↓ αhcontrol-G (or use the ␈↓αq␈↓ command) .)
␈↓ α_␈↓␈↓α(hkstop)␈↓␈α⊃ This␈α⊃function␈α∩turns␈α⊃o≥␈α⊃the␈α⊃stepper␈α∩whenever␈α⊃executed␈α⊃-␈α⊃in␈α∩the␈α⊃same
␈↓ α_␈↓␈↓ αhmanner as the ␈↓αq␈↓ command would.
␈↓ α_␈↓␈↓αhooklist␈↓␈α∪ is␈α∪an␈α∪atom␈α∪whose␈α∪value␈α∪is␈α∪inspected␈α∪before␈α∪each␈α∪attempt␈α∪to␈α∀read␈α∪a
␈↓ α_␈↓␈↓ αhcommand␈αfrom␈αthe␈αconsole.␈α If␈αhooklist␈αis␈αnon-␈↓αnil␈↓,␈αit␈αis␈αassumed␈αto␈αbe␈αa␈αlist␈αof
␈↓ α_␈↓␈↓ αhcommands␈α
to␈α
the␈α
stepper␈α
-␈α
each␈α
is␈α
printed␈α
out␈α
when␈α
used␈α
and␈α
treated␈α
as␈α∞if␈α
it
␈↓ α_␈↓␈↓ αhcame␈α∪from␈α∪your␈α∪typein.␈α∩ ␈↓αhooklist␈↓␈α∪is␈α∪also␈α∪examined␈α∩at␈α∪each␈α∪level␈α∪that␈α∩is
␈↓ α_␈↓␈↓ αhinspected␈α∞by␈α∞the␈α∞stepper␈α∂even␈α∞if␈α∞no␈α∞command␈α∞reading␈α∂is␈α∞done␈α∞(e.g.␈α∞␈↓αnn␈↓␈α∂or␈α∞␈↓αuu␈↓
␈↓ α_␈↓␈↓ αhmodes).
␈↓ α_␈↓␈↓α(mbak)␈↓␈α∃ This␈α∃function␈α∃gives␈α∃␈↓α(baklist)␈↓␈α∃but␈α∃without␈α∃the␈α∃stepper␈α∃functions,␈α∀as
␈↓ α_␈↓␈↓ αhdescribed above.
␈↓ α_␈↓␈↓α(mev␈α␈↓↓top-form␈↓α)␈↓␈α This␈α
function␈αinitiates␈αstepping␈αand␈α
otherwise␈αacts␈αlike␈α␈↓αeval␈↓␈α
of␈αone
␈↓ α_␈↓␈↓ αhargument, as described above.
␈↓ α_␈↓␈↓α(msprint␈α∩␈↓↓form␈↓α)␈↓␈α∪ Gives␈α∩abbreviated␈α∩sprinting␈α∪of␈α∩the␈α∩␈↓↓form␈↓.␈α∪ A␈α∩second␈α∪and␈α∩third
␈↓ α_␈↓␈↓ αhnumeric␈αargument␈αspecify␈αthe␈αe≥ective␈αprinlevel␈αand␈αprinlength␈αhere,␈αelse␈αa␈αlist
␈↓ α_␈↓␈↓ αhof␈α∃two␈α⊗numbers␈α∃found␈α⊗as␈α∃the␈α∃value␈α⊗of␈α∃␈↓↓msprint␈↓␈α⊗are␈α∃used.␈α⊗ The␈α∃current
␈↓ α_␈↓␈↓ αhimplementation␈α⊃is␈α⊂somewhat␈α⊃slow␈α⊃as␈α⊂the␈α⊃regular␈α⊃sprint␈α⊂does␈α⊃not␈α⊃respond␈α⊂to
␈↓ α_␈↓␈↓ αhstandard abbreviating.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ ␈Page 3-41
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓α(sviewmsg␈α␈↓↓lineno␈αtoeval␈↓α)␈↓␈α Useful␈αin␈αconjunction␈αwith␈α␈↓αs␈↓(how)␈αmode.␈α Puts␈α
the␈αcursor
␈↓ α_␈↓␈↓ αhat␈αthe␈α␈↓↓lineno␈↓␈αand␈α
evaluates␈αthe␈αsecond␈αargument,␈α
then␈αreturns␈αthe␈αcursor␈α
to␈αits
␈↓ α_␈↓␈↓ αhoriginal␈αposition.␈α ␈↓↓lineno␈↓␈α=␈α0␈αmeans␈αtop;␈αif␈αnegative␈αcounts␈αfrom␈αbottom,␈αwith␈α
-1
␈↓ α_␈↓␈↓ αhthe␈α∩bottom␈α∩line.␈α∪ Typically␈α∩have␈α∩␈↓α%%mdistitle␈↓␈α∩(see␈α∪␈↓α(s␈α∩-)␈↓␈α∩command)␈α∪be␈α∩a
␈↓ α_␈↓␈↓ αhnumber␈α⊂to␈α⊃skip␈α⊂lines␈α⊃on␈α⊂top,␈α⊂and␈α⊃use␈α⊂␈↓αsviewmsg␈↓␈α⊃to␈α⊂display␈α⊃your␈α⊂debugging
␈↓ α_␈↓␈↓ αhinformation up there.
␈↓ α_␈↓␈↓ αHIf␈α
you␈α
really␈α
want␈α
specialized␈α
processing␈α
in␈α
particular␈α
situations,␈α
you␈α
can␈αinspect
␈↓ α_␈↓and/or␈α⊃change␈α∩␈↓α%%form␈↓␈α⊃in␈α∩a␈α⊃␈↓α(cond␈α⊃...)␈↓␈α∩predicate,␈α⊃and␈α∩␈↓α%%value␈↓␈α⊃in␈α∩a␈α⊃␈↓α(retcond
␈↓ α_␈↓α...)␈↓.␈α If␈α␈↓α%%nohook∨ag␈↓␈αis␈α␈↓αt␈↓,␈αform␈αand␈αvalue␈αprintout␈αand␈αcommand␈αreading␈α(except
␈↓ α_␈↓from␈α⊃a␈α⊃non-␈↓αnil␈↓␈α⊃hooklist)␈α⊃is␈α⊃inhibited␈α⊃until␈α⊃it␈α⊃is␈α⊃reset␈α⊃to␈α⊃␈↓αnil␈↓.␈α⊃ Normal␈α⊂command
␈↓ α_␈↓processing␈α⊂is␈α⊃invoked␈α⊂by␈α⊃␈↓α(%%mhookcom)␈↓␈α⊂with␈α⊂␈↓α%%nohook∨ag␈↓␈α⊃bound␈α⊂to␈α⊃␈↓αnil␈↓.␈α⊂ Also
␈↓ α_␈↓described above are ␈↓α%%breaklist␈↓, ␈↓α%%cond␈↓, ␈↓α%%retcond␈↓, and ␈↓α%%hookprin␈↓.
␈↓ α_␈↓Page 3-42␈↓ ε∃␈↓∧∪3-1.5.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.6 Storage Management␈↓
␈↓ α_␈↓␈↓ αHIn␈α∂MACLISP␈α∂storage␈α∂for␈α∂programs␈α⊂and␈α∂data␈α∂is␈α∂automatically␈α∂managed␈α⊂by␈α∂the
␈↓ α_␈↓system.␈α
The␈α
casual␈α
user␈α
need␈αnot␈α
concern␈α
himself␈α
with␈α
storage␈α
management␈αand␈α
need
␈↓ α_␈↓not␈αread␈αthis␈αsection.␈α However,␈αthe␈αuser␈αwho␈αis␈αcurious␈αabout␈αthe␈αimplementation␈αor
␈↓ α_␈↓who␈α∂has␈α∞to␈α∂construct␈α∂a␈α∞subsystem␈α∂on␈α∂top␈α∞of␈α∂MACLISP␈α∂may␈α∞need␈α∂to␈α∂be␈α∞concerned
␈↓ α_␈↓with␈α∞how␈α∂the␈α∞internal␈α∞storage␈α∂management␈α∞routines␈α∞work␈α∂and␈α∞how␈α∞to␈α∂control␈α∞their
␈↓ α_␈↓general␈α⊃functioning.␈α∩ In␈α⊃no␈α⊃case␈α∩is␈α⊃it␈α⊃necessary␈α∩to␈α⊃control␈α⊃the␈α∩exact␈α⊃step␈α∩by␈α⊃step
␈↓ α_␈↓operations␈αof␈αstorage␈αmanagement,␈αbut␈αa␈αvariety␈αof␈αfunctions␈αare␈αprovided␈αto␈αset␈αthe
␈↓ α_␈↓general policy followed by the lisp storage management procedures.
␈↓ α_␈↓␈↓β1.6.1 Garbage Collection␈↓
␈↓ α_␈↓␈↓ αHGarbage␈α_collection␈α_is␈α_the␈α_mechanism␈α↔which␈α_LISP␈α_uses␈α_to␈α_control␈α↔storage
␈↓ α_␈↓allocation.␈α⊂ Whenever␈α⊂LISP␈α⊂feels␈α⊂that␈α⊃too␈α⊂much␈α⊂storage␈α⊂is␈α⊂being␈α⊂used,␈α⊃a␈α⊂garbage
␈↓ α_␈↓collection␈α∩is␈α⊃initiated.␈α∩ The␈α∩garbage␈α⊃collector␈α∩traces␈α⊃through␈α∩all␈α∩the␈α⊃S-expressions
␈↓ α_␈↓which␈α∪can␈α∪be␈α∪reached␈α∪by␈α∪car'ing␈α∪and␈α∪cdr'ing␈α∪from␈α∪atomic␈α∪symbols'␈α∪values␈α∪and
␈↓ α_␈↓property␈α⊗lists,␈α⊗from␈α⊗forms␈α⊗and␈α⊗temporary␈α⊗results␈α⊗currently␈α⊗being␈α⊗used␈α⊗by␈α⊗the
␈↓ α_␈↓evaluator,␈α∞from␈α∂data␈α∞used␈α∂by␈α∞compiled␈α∂code,␈α∞and␈α∂from␈α∞the␈α∂saved␈α∞values␈α∂of␈α∞bound
␈↓ α_␈↓variables.␈α All␈αthe␈αdata␈αwhich␈αit␈α≡nds␈αin␈αthis␈αway␈αis␈α"good"␈αdata,␈αin␈αthat␈αit␈αis␈αpossible
␈↓ α_␈↓for␈α
it␈αto␈α
be␈αused␈α
again.␈α Everything␈α
else␈αis␈α
garbage,␈αwhich␈α
can␈αnever␈α
again␈α
be␈αused
␈↓ α_␈↓for␈αanything␈αbecause␈αit␈αcannot␈αbe␈αaccessed,␈αso␈αthe␈αstorage␈αused␈αby␈αit␈αis␈αreclaimed␈αand
␈↓ α_␈↓reused.
␈↓ α_␈↓␈↓αgc␈↓ ∧XFSUBR␈↓
␈↓ α_␈↓␈↓ β_␈↓α(gc)␈↓ causes a garbage collection and returns ␈↓αnil␈↓.
␈↓ α_␈↓␈↓αgctwa␈↓ ∧XFSUBR␈↓
␈↓ α_␈↓␈↓ β_␈↓αgctwa␈↓␈α∞is␈α∞used␈α∞to␈α∞control␈α
the␈α∞garbage␈α∞collection␈α∞of␈α∞"truly␈α∞worthless␈α
atoms,"
␈↓ α_␈↓␈↓ αhwhich␈α
are␈α
atomic␈α
symbols␈αwhich␈α
have␈α
no␈α
value␈αand␈α
no␈α
properties,␈α
and␈αwhich
␈↓ α_␈↓␈↓ αhare␈α∂not␈α⊂referenced␈α∂by␈α⊂any␈α∂list␈α∂structure,␈α⊂other␈α∂than␈α⊂the␈α∂obarray␈α⊂(the␈α∂current
␈↓ α_␈↓␈↓ αhobarray if there is more than one).
␈↓ α_␈↓␈↓ β_␈↓α(gctwa)␈↓␈α∞causes␈α∞truly␈α∞worthless␈α∞atoms␈α
to␈α∞be␈α∞removed␈α∞on␈α∞the␈α∞next␈α
garbage
␈↓ α_␈↓␈↓ αhcollection.
␈↓ α_␈↓February 10, 1977␈↓ ε ␈↓∧∪3-1.6␈↓␈↓ {Page 3-43
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ β_␈↓α(gctwa␈α⊂t)␈↓␈α⊂causes␈α⊂truly␈α⊂worthless␈α∂atoms␈α⊂to␈α⊂be␈α⊂removed␈α⊂on␈α⊂each␈α∂garbage
␈↓ α_␈↓␈↓ αhcollection from now on. Note: ␈↓αgctwa␈↓ does not evaluate its argument.
␈↓ α_␈↓␈↓ β_␈↓α(gctwa␈α∞nil)␈↓␈α
causes␈α∞this␈α
continual␈α∞removal␈α
of␈α∞truly␈α
worthless␈α∞atoms␈α∞to␈α
be
␈↓ α_␈↓␈↓ αhshut␈α⊂o≥,␈α⊂but␈α⊂it␈α⊂does␈α⊃not␈α⊂a≥ect␈α⊂whether␈α⊂the␈α⊂next␈α⊂garbage␈α⊃collection␈α⊂removes
␈↓ α_␈↓␈↓ αhtwa's.
␈↓ α_␈↓␈↓ β_The␈α∪value␈α∪returned␈α∀by␈α∪␈↓αgctwa␈↓␈α∪is␈α∀a␈α∪≡xnum␈α∪which␈α∀is␈α∪0␈α∪if␈α∀no␈α∪garbage
␈↓ α_␈↓␈↓ αhcollection␈αof␈αtruly␈αworthless␈αatoms␈αwill␈αbe␈αdone,␈α1␈αif␈αtwa's␈αare␈αto␈αbe␈αgc'ed␈αon␈α
the
␈↓ α_␈↓␈↓ αhnext␈αgarbage␈αcollection,␈α10␈αif␈αtwa's␈αare␈αto␈αbe␈αgc'ed␈αon␈αall␈αgarbage␈αcollections,␈αor
␈↓ α_␈↓␈↓ αh11 if both. (These numbers are octal.)
␈↓ α_␈↓␈↓α↑d␈↓ ∧XSWITCH␈↓
␈↓ α_␈↓␈↓ β_If␈α
the␈α
value␈α
of␈α
␈↓α↑d␈↓␈α
is␈α
non-␈↓αnil␈↓,␈α
the␈α
garbage␈α
collector␈α
prints␈α∞an␈α
informative
␈↓ α_␈↓␈↓ αhmessage each time garbage collection occurs.
␈↓ α_␈↓See also the user interrupts ␈↓αgc-daemon␈↓, ␈↓αgc-over∨ow␈↓, and ␈↓αgc-lossage␈↓.
␈↓ α_␈↓␈↓β1.6.2 Spaces␈↓
␈↓ α_␈↓␈↓ αHIn␈α
MACLISP␈αthe␈α
storage␈αused␈α
for␈α
LISP␈αobjects␈α
is␈αdivided␈α
into␈αseveral␈α
conceptual
␈↓ α_␈↓subdivisions,␈αcalled␈α␈↓↓spaces.␈↓␈αEach␈αspace␈αcontains␈αa␈αdi≥erent␈αtype␈αof␈α
object.␈α Allocation
␈↓ α_␈↓proceeds␈αseparately␈αin␈αthe␈αdi≥erent␈αspaces,␈αbut␈αgarbage␈αcollection␈αof␈αall␈αspaces␈αoccurs
␈↓ α_␈↓together␈α
since␈α
an␈α
object␈α
in␈αone␈α
space␈α
could␈α
contain␈α
a␈αpointer␈α
to␈α
an␈α
object␈α
in␈αany␈α
other
␈↓ α_␈↓space.
␈↓ α_␈↓␈↓ αHFor␈αexample,␈αin␈αthe␈α"Bibop"␈αversion␈αof␈αthe␈αpdp-10␈αimplementation,␈αthe␈αspaces␈αare
␈↓ α_␈↓as follows:
␈↓ α_␈↓␈↓ α8␈↓αLIST␈↓ β8␈↓conses (dotted pairs) and lists.
␈↓ α_␈↓␈↓ α8␈↓αFIXNUM␈↓ β8␈↓≡xnums.
␈↓ α_␈↓␈↓ α8␈↓αFLONUM␈↓ β8␈↓∨onums.
␈↓ α_␈↓␈↓ α8␈↓αBIGNUM␈↓ β8␈↓bignum headers. bignums also occupy ≡xnum and list space.
␈↓ α_␈↓␈↓ α8␈↓αSYMBOL␈↓ β8␈↓atomic symbols.
␈↓ α_␈↓Page 3-44␈↓ ε∃␈↓∧∪3-1.6.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ α8␈↓αARRAY␈↓ β8␈↓"special array cells."
␈↓ α_␈↓␈↓ α8␈↓αREGPDL␈↓ β8␈↓the "regular" pushdown list.
␈↓ α_␈↓␈↓ α8␈↓αSPECPDL␈↓ β8␈↓the "special" pushdown list, used in binding.
␈↓ α_␈↓␈↓ α8␈↓αFXPDL␈↓ β8␈↓the ≡xnum pushdown list, used for temporary numeric values.
␈↓ α_␈↓␈↓ α8␈↓αFLPDL␈↓ β8␈↓the ∨onum pushdown list, used for temporary numeric values.
␈↓ α_␈↓␈↓ α8Binary Program Space used to hold arrays and compiled code.
␈↓ α_␈↓␈↓ α8pure ␈↓αLIST␈↓, pure ␈↓αFIXNUM␈↓, pure ␈↓αFLONUM␈↓, pure ␈↓αBIGNUM␈↓
␈↓ α_␈↓␈↓ β8These␈α∞spaces␈α∞are␈α∂used␈α∞to␈α∞store␈α∞"pure"␈α∂data␈α∞of␈α∞the␈α∞four␈α∂indicated␈α∞types.
␈↓ α_␈↓␈↓ β8This is a feature used to make subsystems more e~cient. See part 6.5.
␈↓ α_␈↓␈↓ αHIn the Multics implementation, the spaces are:
␈↓ α_␈↓␈↓ α8␈↓αlist␈↓ β8␈↓conses (dotted pairs), lists, atomic symbols, bignums, and strings.
␈↓ α_␈↓␈↓ α8Static Storage arrays, ≡les, and linkage to compiled code.
␈↓ α_␈↓␈↓ α8␈↓αmarkedpdl ␈↓a pushdown list of lisp objects.
␈↓ α_␈↓␈↓ α8␈↓αunmarkedpdl ␈↓a pushdown list of machine data, not lisp objects.
␈↓ α_␈↓␈↓ αHNote:␈α∩ in␈α∩the␈α∪Multics␈α∩implementation␈α∩there␈α∩is␈α∪no␈α∩space␈α∩for␈α∪numbers␈α∩because
␈↓ α_␈↓numbers are stored in such a way that they do not take up any extra room.
␈↓ α_␈↓␈↓ αHAssociated␈α∀with␈α∀each␈α∃space␈α∀is␈α∀information␈α∃determining␈α∀when␈α∀an␈α∃attempt␈α∀to
␈↓ α_␈↓allocate␈αin␈αthat␈αspace␈αshould␈αcause␈αa␈αgarbage␈αcollection.␈α The␈αidea␈αis␈αthat␈αone␈αshould
␈↓ α_␈↓allocate␈α
for␈αquite␈α
a␈αwhile␈α
in␈αa␈α
space,␈αand␈α
then␈αdecide␈α
that␈αit␈α
is␈αworth␈α
the␈α
trouble␈αof
␈↓ α_␈↓doing␈α
an␈α
expensive␈α
garbage␈α
collection␈α
in␈αorder␈α
to␈α
prevent␈α
the␈α
space␈α
from␈α
using␈αtoo
␈↓ α_␈↓many bits of actual storage.
␈↓ α_␈↓␈↓ αHThe␈α
exact␈α
nature␈α
of␈α
this␈α
information␈α
varies␈α
with␈α
the␈α
space.␈α
In␈α
a␈α
pushdown␈αlist
␈↓ α_␈↓(pdl)␈α⊂space,␈α⊂all␈α⊂information␈α⊂must␈α⊃be␈α⊂stored␈α⊂contiguously␈α⊂so␈α⊂the␈α⊂only␈α⊃parameter␈α⊂of
␈↓ α_␈↓interest␈αis␈αhow␈α
big␈αthe␈αpdl␈α
is.␈α This␈αcan␈αbe␈α
measured␈αin␈αthree␈α
ways,␈αso␈αthere␈αare␈α
three
␈↓ α_␈↓parameters associated with a pdl:
␈↓ α_␈↓␈↓ α8pdlsize␈↓ β8the number of words of valid data in the pdl at the moment.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.6.2␈↓␈↓ {Page 3-45
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ α8pdlmax␈↓ β8the␈αsize␈αto␈α
which␈αthe␈αpdl␈α
may␈αgrow␈αbefore␈α
intervention␈αis␈αrequired.␈α
This
␈↓ α_␈↓␈↓ β8is used to detect in≡nite recursion.
␈↓ α_␈↓␈↓ α8pdlroom␈↓ β8the size beyond which the pdl may not grow no matter what.
␈↓ α_␈↓␈↓ αHA␈α∞space␈α∞such␈α∞as␈α∞a␈α∞list␈α∞space␈α∞has␈α∞three␈α∞parameters,␈α∞called␈α∞the␈α∞␈↓↓gcsize␈↓,␈α∞␈↓↓gcmax␈↓,␈α
and
␈↓ α_␈↓␈↓↓gcmin␈↓.␈α These␈αare␈αin␈αmachine-dependent␈αunits␈αof␈α"words."␈αThe␈αgcsize␈αis␈αthe␈αexpected
␈↓ α_␈↓size␈α
of␈α∞the␈α
space;␈α∞as␈α
objects␈α∞are␈α
allocated␈α∞in␈α
the␈α∞space␈α
it␈α∞will␈α
grow␈α∞without␈α
garbage
␈↓ α_␈↓collection␈α∞until␈α∞it␈α∞reaches␈α∞this␈α∞size.␈α∞ When␈α∞it␈α∞gets␈α∞above␈α∞this␈α∞size␈α∂garbage␈α∞collection
␈↓ α_␈↓will occasionally be required, under control of the other two parameters.
␈↓ α_␈↓␈↓ αHThe␈α
gcmax␈α
is␈α
the␈α
maximum␈α
size␈α
to␈α
which␈α
the␈α
space␈α
should␈α
grow;␈α
if␈α
it␈α∞gets␈α
this
␈↓ α_␈↓big␈α∞garbage␈α∞collections␈α∞will␈α
occur␈α∞quite␈α∞frequently␈α∞in␈α
an␈α∞attempt␈α∞to␈α∞prevent␈α∞it␈α
from
␈↓ α_␈↓growing bigger.
␈↓ α_␈↓␈↓ αHThe␈α
gcmin␈αspeci≡es␈α
the␈αminimum␈α
amount␈α
of␈αfree␈α
space␈αafter␈α
a␈αgarbage␈α
collection.
␈↓ α_␈↓It␈α⊂may␈α⊂be␈α⊂either␈α⊂a␈α⊂≡xnum,␈α⊂which␈α⊂speci≡es␈α∂the␈α⊂number␈α⊂of␈α⊂words␈α⊂to␈α⊂be␈α⊂free,␈α⊂or␈α∂a
␈↓ α_␈↓∨onum␈αwhich␈αspeci≡es␈αthe␈αfraction␈αof␈αthe␈αspace␈αto␈αbe␈αfree.␈α The␈αexact␈αinterpretation
␈↓ α_␈↓of␈α∂this␈α∂depends␈α∂on␈α∂the␈α∂implementation.␈α∂ In␈α∂the␈α∂pdp-10␈α∂implementation,␈α⊂which␈α∂uses
␈↓ α_␈↓free␈α⊃storage␈α⊃lists,␈α⊂the␈α⊃gcmin␈α⊃is␈α⊂the␈α⊃number␈α⊃of␈α⊂words␈α⊃which␈α⊃must␈α⊂be␈α⊃on␈α⊃the␈α⊂free
␈↓ α_␈↓storage␈αlist␈αafter␈αa␈αgarbage␈αcollection.␈α If␈αthere␈αare␈αnot␈αthis␈αmany,␈αthe␈αspace␈αis␈αgrown,
␈↓ α_␈↓except␈αif␈αits␈αsize␈αapproaches␈αgcmax␈αit␈αmay␈αnot␈αbe␈αgrown␈αby␈αthe␈αfull␈αamount.␈α In␈αthe
␈↓ α_␈↓Multics␈α
implementation,␈α
which␈αuses␈α
a␈α
compacting␈αgarbage␈α
collector,␈α
the␈α
criterion␈αfor
␈↓ α_␈↓garbage␈αcollection␈α
is␈αnot␈α
when␈αa␈αfree␈α
list␈αis␈α
exhausted␈αbut␈αwhen␈α
the␈αspace␈α
reaches␈αa
␈↓ α_␈↓certain␈α⊃size.␈α⊃ This␈α⊃size␈α⊃is␈α⊃the␈α⊃maximum␈α⊃of␈α⊃gcsize␈α⊃and␈α⊃the␈α⊃sum␈α⊃of␈α⊃the␈α⊃size␈α⊃after
␈↓ α_␈↓compacti≡cation␈αplus␈αgcmin␈α(if␈αit␈αis␈αa␈α≡xnum)␈αor␈αthe␈αsize␈αafter␈αcompacti≡cation␈αtimes
␈↓ α_␈↓1/(1-gcmin)␈α
(if␈α
gcmin␈α
is␈αa␈α
∨onum.)␈α
The␈α
e≥ect␈αof␈α
this␈α
is␈α
to␈αallow␈α
the␈α
same␈α
amount␈αof
␈↓ α_␈↓allocation␈α
between␈α
garbage␈αcollections␈α
as␈α
there␈α
would␈αbe␈α
in␈α
the␈αpdp-10␈α
implementation
␈↓ α_␈↓with the same gcmin.
␈↓ α_␈↓␈↓ αHNote␈αthat␈αthese␈αcontrols␈αover␈αthe␈αsizes␈αof␈αspaces␈αare␈αsomewhat␈αinexact,␈αsince␈αthere
␈↓ α_␈↓is␈α
rounding.␈α∞ For␈α
instance,␈α
the␈α∞Bibop␈α
version␈α
of␈α∞the␈α
pdp-10␈α∞impementation␈α
allocates
␈↓ α_␈↓memory␈α∪to␈α∩spaces␈α∪in␈α∩blocks␈α∪of␈α∪256.␈α∩or␈α∪512.␈α∩words.␈α∪ The␈α∪Multics␈α∩implementation
␈↓ α_␈↓allocates␈α
at␈α∞least␈α
16,384␈α
words␈α∞between␈α
garbage␈α
collections␈α∞and␈α
presently␈α∞controls␈α
the
␈↓ α_␈↓size of pushdown lists in blocks of 16. words.
␈↓ α_␈↓␈↓ αHSome␈α⊂spaces,␈α⊃such␈α⊂as␈α⊃Binary␈α⊂Program␈α⊃Space␈α⊂in␈α⊃the␈α⊂pdp-10␈α⊃implementation␈α⊂or
␈↓ α_␈↓Static␈α
space␈α
in␈α
the␈αMultics␈α
implementation␈α
are␈α
not␈αsubject␈α
to␈α
detailed␈α
control␈α
by␈αthe
␈↓ α_␈↓user.␈α⊂ The␈α⊂management␈α⊃of␈α⊂these␈α⊂spaces␈α⊂is␈α⊃entirely␈α⊂automatic.␈α⊂ Generally␈α⊃these␈α⊂are
␈↓ α_␈↓spaces␈α∞where␈α∞the␈α
rate␈α∞of␈α∞allocation␈α
is␈α∞fairly␈α∞placid␈α
and␈α∞most␈α∞objects,␈α∞once␈α
allocated,
␈↓ α_␈↓are␈α↔used␈α↔forever␈α⊗and␈α↔never␈α↔freed.␈α⊗ Hence␈α↔the␈α↔exact␈α⊗policy␈α↔used␈α↔for␈α⊗storage
␈↓ α_␈↓management in these spaces is not too important.
␈↓ α_␈↓Page 3-46␈↓ ε∃␈↓∧∪3-1.6.2␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.6.3 Storage Control Functions␈↓
␈↓ α_␈↓␈↓αalloc␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_The␈α⊃␈↓αalloc␈↓␈α∩function␈α⊃is␈α∩used␈α⊃to␈α∩examine␈α⊃and␈α∩set␈α⊃parameters␈α∩of␈α⊃various
␈↓ α_␈↓␈↓ αhspaces␈α↔having␈α↔to␈α↔do␈α↔with␈α⊗storage␈α↔management.␈α↔ To␈α↔set␈α↔parameters,␈α⊗the
␈↓ α_␈↓␈↓ αhargument␈α∂to␈α∞␈↓αalloc␈↓␈α∂should␈α∞be␈α∂a␈α∂list␈α∞containing␈α∂an␈α∞even␈α∂number␈α∂of␈α∞elements.
␈↓ α_␈↓␈↓ αhThe␈α
≡rst␈α
element␈αof␈α
a␈α
pair␈αis␈α
the␈α
name␈α
of␈αa␈α
space,␈α
and␈αthe␈α
second␈α
is␈α
either␈αa
␈↓ α_␈↓␈↓ αh≡xnum␈αor␈αa␈α3-list.␈α A␈α≡xnum␈αspeci≡es␈αthe␈αpdlsize␈α(for␈αa␈αpdl␈αspace)␈αor␈αthe␈α
gcsize
␈↓ α_␈↓␈↓ αh(for␈α∞other␈α∞spaces.)␈α∞A␈α∞3-list␈α∞speci≡es,␈α
from␈α∞left␈α∞to␈α∞right,␈α∞the␈α∞gcsize,␈α∞gcmax,␈α
and
␈↓ α_␈↓␈↓ αhgcmin.␈α ␈↓αnil␈↓␈αmeans␈α"don't␈αchange␈αthis␈αparameter."␈αOtherwise␈αa␈α≡xnum␈αmust␈αbe
␈↓ α_␈↓␈↓ αhsupplied,␈αexcept␈αin␈αthe␈αthird␈αelement␈α(the␈αgcmin),␈αwhere␈αa␈α∨onum␈αis␈αacceptable.
␈↓ α_␈↓␈↓ αhA 3-list cannot be used with a pdl space.
␈↓ α_␈↓␈↓ β_An example of this use of ␈↓αalloc␈↓, in the pdp-10 Bibop implementation:
␈↓ α_␈↓␈↓ β8␈↓α(alloc '(list (30000. 5000. 0.25)
␈↓ α_␈↓α␈↓ β8 ≡xnum (4000. 7000. nil)
␈↓ α_␈↓α␈↓ β8 regpdl 2000.))
␈↓ α_␈↓␈↓ αhor, in the Multics implementation:
␈↓ α_␈↓␈↓ β8␈↓α(alloc '(list (30000. nil 0.3)
␈↓ α_␈↓α␈↓ β8 markedpdl 5000.
␈↓ α_␈↓α␈↓ β8 unmarkedpdl 5000.))
␈↓ α_␈↓␈↓ β_␈↓αalloc␈↓␈α
may␈α
also␈α
be␈α
called␈α
with␈α
an␈α
argument␈α
of␈α
␈↓αt␈↓,␈α
which␈α
causes␈α
it␈α
to␈αreturn␈α
a
␈↓ α_␈↓␈↓ αhlist␈α
of␈α
all␈α
the␈α
spaces␈α
and␈α
their␈α
parameters.␈α
This␈α
list␈α
is␈α
in␈α
a␈α
form␈α
such␈α
that␈α
it
␈↓ α_␈↓␈↓ αhcould␈αbe␈αgiven␈α
back␈αto␈α␈↓αalloc␈↓␈αat␈α
some␈αlater␈αtime␈αto␈α
set␈αthe␈αparameters␈α
back␈αto
␈↓ α_␈↓␈↓ αhwhat they are now.
␈↓ α_␈↓␈↓ αHSee for some ␈↓αstatus␈↓ functions which are related to the topic of storage spaces.
␈↓ α_␈↓␈↓β1.6.4 Dynamic Space and Pdl Expansion␈↓
␈↓ α_␈↓␈↓ αHThere␈α∩are␈α⊃several␈α∩user␈α∩interrupts␈α⊃generated␈α∩by␈α⊃the␈α∩storage␈α∩management.␈α⊃ See
␈↓ α_␈↓section␈α1.4␈αfor␈αa␈αdescription␈αof␈αuser␈αinterrupts.␈α The␈α␈↓αgc-daemon␈↓␈αinterrupt␈αoccurs␈α
after
␈↓ α_␈↓each␈αgarbage␈αcollection.␈α The␈αargument␈αpassed␈αto␈αthe␈αgc-daemon␈αinterrupt␈αhandler␈αis
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.6.3␈↓␈↓ {Page 3-47
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓a␈αlist␈αof␈αitems;␈αeach␈αitem␈αhas␈αthe␈αform␈α␈↓α(space␈αbefore␈α.␈αafter)␈↓,␈αwhere␈α␈↓αspace␈↓␈αis␈αthe
␈↓ α_␈↓name␈α∩of␈α⊃a␈α∩space,␈α⊃␈↓αbefore␈↓␈α∩indicates␈α⊃the␈α∩number␈α⊃of␈α∩cells␈α⊃free␈α∩before␈α∩the␈α⊃garbage
␈↓ α_␈↓collection,␈α
and␈α
␈↓αafter␈↓␈α
indicates␈α
the␈α∞number␈α
of␈α
cells␈α
free␈α
afterwards.␈α
(In␈α∞the␈α
Multics
␈↓ α_␈↓implementation,␈α⊂where␈α⊂"free␈α⊂cells"␈α⊂is␈α⊂a␈α⊂meaningless␈α⊂concept,␈α⊂only␈α⊂the␈α⊃di≥erence␈α⊂of
␈↓ α_␈↓these two numbers is signi≡cant. It represents the amount of compaction achieved.)
␈↓ α_␈↓␈↓ αHThe␈α␈↓αgc-lossage␈↓␈αinterrupt␈αoccurs␈αif␈αthe␈αgarbage␈αcollector␈αtries␈αto␈αexpand␈αa␈αspace
␈↓ α_␈↓but␈αfails␈αbecause,␈αfor␈αexample,␈αthe␈αoperating␈α
system␈αwill␈αnot␈αgive␈αit␈αany␈αmore␈α
storage.
␈↓ α_␈↓The␈αargument␈αpassed␈αto␈αthe␈αinterrupt␈αservice␈αfunction␈αis␈αthe␈αname␈αof␈αthe␈αspace␈αthat
␈↓ α_␈↓lost.
␈↓ α_␈↓␈↓ αHThe␈α∂␈↓αpdl-over∨ow␈↓␈α∂interrupt␈α∂is␈α∂signalled␈α∂when␈α∂some␈α∂pushdown␈α∂list␈α∂exceeds␈α∂its
␈↓ α_␈↓pdlmax.␈α∂ The␈α∂pdlmax␈α∂is␈α∂increased␈α∂slightly␈α∂so␈α∂that␈α∂the␈α∂interrupt␈α∂handler␈α⊂will␈α∂have
␈↓ α_␈↓room␈αto␈αrun.␈α The␈αargument␈αpassed␈αto␈αthe␈αinterrupt␈αfunction␈αis␈αthe␈αname␈αof␈αthe␈αpdl
␈↓ α_␈↓that␈αover∨owed.␈α If␈α
the␈αinterrupt␈αfunction␈α
uses␈αtoo␈αmuch␈α
pdl,␈αthis␈αinterrupt␈αwill␈α
occur
␈↓ α_␈↓again.␈α
If␈α
this␈α
happens␈αenough␈α
times,␈α
the␈α
pdlmax␈αwill␈α
reach␈α
the␈α
pdlroom,␈α
there␈αwill
␈↓ α_␈↓be no room in the pdl to take a user interrupt, and an uncorrectable error will occur.
␈↓ α_␈↓␈↓ αHThe␈α
interrupt␈α∞function␈α
can␈α∞decide␈α
to␈α
terminate␈α∞the␈α
computation␈α∞that␈α
over∨owed
␈↓ α_␈↓the␈αpdl,␈αby␈α
doing␈αan␈α␈↓α(ioc␈α
g)␈↓␈αor␈αa␈α␈↓α(throw)␈↓,␈α
or␈αit␈αcan␈α
increase␈αthe␈αpdlmax␈α
by␈αusing
␈↓ α_␈↓␈↓αalloc␈↓␈αor␈α␈↓α(sstatus␈αpdlmax)␈↓␈αand␈αthen␈αcontinue␈αthe␈αcomputation␈αby␈αreturning.␈α Note
␈↓ α_␈↓that␈α∀unlike␈α∀most␈α∀other␈α∀user␈α∀interrupts,␈α∀if␈α∀the␈α∀␈↓αpdl-over∨ow␈↓␈α∀interrupt␈α∀function
␈↓ α_␈↓returns␈α␈↓αnil␈↓␈α(or␈αthe␈α"␈↓α;bkpt␈αpdl-over∨ow␈↓"␈αis␈α␈↓α$p␈↓'ed),␈αthe␈αcomputation␈αis␈αcontinued␈αas
␈↓ α_␈↓if the pdl over∨ow had not occurred.
␈↓ α_␈↓␈↓ αHThe␈α
␈↓αgc-over∨ow␈↓␈α
interrupt␈α
occurs␈α
when␈αsome␈α
space␈α
(other␈α
than␈α
a␈α
pdl)␈αexceeds␈α
its
␈↓ α_␈↓gcmax.␈α
This␈α
gives␈α
the␈αuser␈α
a␈α
chance␈α
to␈αdecide␈α
that␈α
the␈α
size␈αof␈α
the␈α
space␈α
should␈αbe
␈↓ α_␈↓increased␈α∀and␈α∀the␈α∀computation␈α∀continued,␈α∀or␈α∀that␈α∀something␈α∀is␈α∀wrong␈α∃and␈α∀the
␈↓ α_␈↓computation␈αshould␈αbe␈αterminated.␈α The␈αargument␈αpassed␈αto␈αthe␈αinterrupt␈αhandler␈αis
␈↓ α_␈↓the␈αname␈αof␈αthe␈αspace␈αthat␈αover∨owed.␈α The␈αinterrupt␈αhandling␈αfunction␈αwill␈αbe␈αable
␈↓ α_␈↓to␈α∂run␈α∂because␈α∂the␈α∂garbage␈α∂collector␈α∂makes␈α∂sure␈α∂that␈α∂the␈α∂space␈α∂is␈α∂su~ciently␈α∞large
␈↓ α_␈↓before␈αsignalling␈αthe␈αinterrupt,␈α
even␈αif␈αthis␈αmakes␈α
it␈αbecome␈αsomewhat␈αlarger␈αthan␈α
its
␈↓ α_␈↓gcmax.␈α This␈αinterrupt␈αis␈αsimilar␈αto␈α␈↓αpdl-over∨ow␈↓;␈αif␈αthe␈αinterrupt␈αhandler␈αfunction
␈↓ α_␈↓returns␈α∪at␈α∪all,␈α∪even␈α∪if␈α∪it␈α∪returns␈α∪nil,␈α∪the␈α∪interrupted␈α∪computation␈α∀proceeds.␈α∪ To
␈↓ α_␈↓terminate the computation an explicit ␈↓α(ioc g), (throw)␈↓, or ␈↓α(error)␈↓ must be done.
␈↓ α_␈↓␈↓β1.6.5 Initial Allocation␈↓
␈↓ α_␈↓␈↓ αHThe␈αpdp-10␈α
implementations␈αof␈α
MACLISP␈αrun␈α
on␈αa␈α
machine␈αwith␈α
a␈αlimited-size
␈↓ α_␈↓address␈α∪space.␈α∪ Consequently␈α∪the␈α∪allocation␈α∪of␈α∪portions␈α∪of␈α∪this␈α∪address␈α∀space␈α∪to
␈↓ α_␈↓Page 3-48␈↓ ε∃␈↓∧∪3-1.6.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓di≥erent␈α∞uses,␈α
such␈α∞as␈α
LISP␈α∞storage␈α
spaces,␈α∞becomes␈α
important.␈α∞ This␈α∞is␈α
particularly
␈↓ α_␈↓true␈αof␈α
implementations␈αwithout␈α
the␈α"Bibop"␈αfeature,␈α
which␈αdo␈α
not␈αtake␈αadvantage␈α
of
␈↓ α_␈↓paging.
␈↓ α_␈↓␈↓ αHWhen␈α∞LISP␈α∞is␈α
≡rst␈α∞entered,␈α∞it␈α∞goes␈α
through␈α∞a␈α∞dialogue␈α
with␈α∞the␈α∞user␈α∞known␈α
as
␈↓ α_␈↓"allocation."␈α∞ Normally␈α∂the␈α∞dialogue␈α∂simply␈α∞consists␈α∂of␈α∞the␈α∂user␈α∞declining␈α∂to␈α∞specify
␈↓ α_␈↓anything,␈α
in␈α
which␈α
case␈α
LISP␈α
chooses␈α
suitable␈αdefaults.␈α
If␈α
a␈α
large␈α
problem␈α
is␈α
to␈αbe
␈↓ α_␈↓worked␈α∞on,␈α
the␈α∞defaults␈α∞may␈α
be␈α∞inappropriate␈α
and␈α∞it␈α∞may␈α
be␈α∞necessary␈α∞to␈α
explicitly
␈↓ α_␈↓allocate␈α
a␈α
larger␈αamount␈α
of␈α
storage.␈α
It␈αis␈α
also␈α
possible␈α
for␈αthe␈α
user's␈α
replies␈α
to␈αcome
␈↓ α_␈↓from a ≡le.
␈↓ α_␈↓␈↓ αHIf LISP is called with a command line from DDT, for example
␈↓ α_␈↓␈↓ ¬⊂␈↓α:LISP INDEX LOADER COM:␈↓
␈↓ α_␈↓it␈α∂reads␈α⊂the␈α∂indicated␈α∂≡le␈α⊂in␈α∂the␈α∂same␈α⊂way␈α∂that␈α∂it␈α⊂would␈α∂read␈α∂.LISP.␈α⊂(INIT).␈α∂ See
␈↓ α_␈↓below.
␈↓ α_␈↓␈↓ αHOn␈α
the␈α
other␈α
hand,␈α
if␈α
LISP␈α
is␈α
called␈α
without␈α
a␈α
command␈α
line,␈α
it␈α
identi≡es␈αitself
␈↓ α_␈↓and asks
␈↓ α_␈↓␈↓ ε_␈↓αALLOC?␈↓
␈↓ α_␈↓Suitable␈α
responses␈α
are␈α
Y,␈α
N,␈α
and␈α
CTRL/Q.␈α
There␈α
are␈α
other␈α
obscure␈α
characters␈α
which
␈↓ α_␈↓can␈α
be␈α
used␈α
as␈αreplies␈α
to␈α
this␈α
question,␈α
but␈αthese␈α
three␈α
are␈α
su~cient␈α
for␈αmost␈α
purposes.
␈↓ α_␈↓"N"␈α⊃means␈α⊃that␈α⊂you␈α⊃do␈α⊃not␈α⊃want␈α⊂to␈α⊃specify␈α⊃allocation.␈α⊂ You␈α⊃will␈α⊃get␈α⊃the␈α⊂default.
␈↓ α_␈↓CTRL/Q␈α
means␈α
to␈α
read␈α
your␈α
initialization␈α
≡le␈α
(see␈α
below.)␈α
"Y"␈α
means␈α
that␈α
you␈α
wish␈α
to
␈↓ α_␈↓go through the following sequence of questions and answers.
␈↓ α_␈↓␈↓ αHLISP␈α∩types␈α∪out␈α∩the␈α∪names␈α∩of␈α∪various␈α∩spaces␈α∪and␈α∩their␈α∪sizes.␈α∩ The␈α∪≡rst␈α∩one,
␈↓ α_␈↓"CORE",␈α
is␈α
special.␈α It␈α
is␈α
not␈α
a␈αspace␈α
but␈α
the␈α
total␈αamount␈α
of␈α
address␈α
space␈αdesired,
␈↓ α_␈↓and␈α⊃the␈α⊃size␈α⊃is␈α∩in␈α⊃pages␈α⊃rather␈α⊃than␈α⊃words.␈α∩ After␈α⊃each␈α⊃question␈α⊃you␈α∩may␈α⊃enter
␈↓ α_␈↓altmode,␈α
which␈α
terminates␈α∞the␈α
dialogue␈α
and␈α∞gives␈α
the␈α
remaining␈α∞parameters␈α
default
␈↓ α_␈↓values,␈α∞or␈α
space␈α∞which␈α
goes␈α∞on␈α
to␈α∞the␈α
next␈α∞question.␈α
Before␈α∞your␈α
altmode␈α∞or␈α
space
␈↓ α_␈↓you␈α∞may␈α∞put␈α
a␈α∞number␈α∞which␈α
is␈α∞the␈α∞size␈α∞you␈α
want␈α∞that␈α∞space␈α
to␈α∞be,␈α∞instead␈α∞of␈α
the
␈↓ α_␈↓number␈α∂that␈α∂was␈α∂printed.␈α∂ Again,␈α∞there␈α∂are␈α∂various␈α∂other␈α∂magic␈α∂characters␈α∞besides
␈↓ α_␈↓space and altmode. CTRL/G restarts the dialogue with the "ALLOC?" question.
␈↓ α_␈↓␈↓ αHIf␈αyou␈αreply␈αwith␈αa␈αcontrol-Q,␈αit␈αmeans␈αto␈αread␈αyour␈αinitialization␈α≡le.␈α In␈αthe␈αITS
␈↓ α_␈↓implementation,␈α
this␈αis␈α
either␈α␈↓↓udir␈↓α;␈α
.LISP.␈α(INIT)␈↓␈α
or␈α␈↓α(INIT);␈α
␈↓↓udir␈↓α␈α
.LISP.␈↓,␈αwhere
␈↓ α_␈↓␈↓↓udir␈↓␈α
is␈α∞your␈α
master␈α∞sname.␈α
In␈α∞the␈α
DEC-10␈α∞implementation,␈α
this␈α∞is␈α
␈↓αLISP.INI␈↓␈α∞in␈α
the
␈↓ α_␈↓directory␈α$you␈α#are␈α$logged␈α#in␈α$to.␈α# In␈α$the␈α#Multics␈α$implementation,␈α#this
␈↓ α_␈↓␈↓↓hd␈↓α>start←up.lisp␈↓,␈α≡where␈α≡␈↓↓hd␈↓␈α≡is␈α≡your␈α≡home␈α≡directory.␈α≡ Since␈α≡the␈α≥Multics
␈↓ α_␈↓implementation␈αdoesn't␈αhave␈αthe␈αallocation␈αdialogue,␈αthis␈α≡le␈αis␈αalways␈αread␈αwhen␈αthe
␈↓ α_␈↓lisp command is given with no arguments.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.6.5␈↓␈↓ zPage 3-49
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αHThe␈α⊃≡rst␈α⊂form␈α⊃in␈α⊃the␈α⊂≡le␈α⊃should␈α⊂be␈α⊃a␈α⊃comment␈α⊂which␈α⊃is␈α⊂used␈α⊃to␈α⊃answer␈α⊂the
␈↓ α_␈↓questions.␈α Note␈αthat␈αsupplying␈αnonexistent␈αspace␈αnames␈αin␈αthe␈αcomment␈αdoesn't␈αhurt,
␈↓ α_␈↓so␈αyou␈α
can␈αuse␈αthe␈α
same␈αcomment␈αfor␈α
both␈αBibop␈αand␈α
non-Bibop␈αLISP.␈α An␈α
example
␈↓ α_␈↓of the form of this comment is:
␈↓ α_␈↓α␈↓ ∧λ(comment fxs 4000 ≡xnum 5000 ∨s 2000
␈↓ α_␈↓α␈↓ ∧λ symbol 4000 ∨onum 2000 bignum 1400)
␈↓ α_␈↓␈↓ αHThe remaining forms in the ≡le are simply read and evaluated.
␈↓ α_␈↓Page 3-50␈↓ ε∃␈↓∧∪3-1.6.5␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.7 Implementing Subsystems with MACLISP␈↓
␈↓ α_␈↓␈↓β1.7.1 Entering LISP␈↓
␈↓ α_␈↓␈↓ αHA␈αsubsystem␈αis␈αan␈αentity␈αthat␈αexists␈αin␈αmost␈αtime-sharing␈αsystems.␈α It␈αis␈αnormally␈αa
␈↓ α_␈↓complete␈α
world␈α
which␈αthe␈α
user␈α
enters␈αby␈α
typing␈α
a␈αcommand.␈α
He␈α
then␈α
has␈αwhatever
␈↓ α_␈↓facilities␈αthe␈αsubsystem␈αo≥ers.␈α A␈α
subsystem␈αcan␈αbe␈αoriented␈αtoward␈α
programming,␈αas
␈↓ α_␈↓the␈α⊗MACLISP␈α↔subsystem␈α⊗itself␈α↔is,␈α⊗or␈α⊗it␈α↔can␈α⊗be␈α↔oriented␈α⊗toward␈α↔a␈α⊗particular
␈↓ α_␈↓application,␈α∞for␈α
instance␈α∞compiling␈α
LISP␈α∞programs,␈α
operating␈α∞machinery,␈α∞or␈α
solving
␈↓ α_␈↓di≥erential equations.
␈↓ α_␈↓␈↓ αHMACLISP␈α→is␈α~frequently␈α→used␈α→as␈α~a␈α→base␈α→on␈α~which␈α→to␈α~build␈α→subsystems.
␈↓ α_␈↓Consequently␈α∞it␈α∞has␈α∞been␈α∞equipped␈α∂with␈α∞a␈α∞number␈α∞of␈α∞mechanisms␈α∞which␈α∂allow␈α∞the
␈↓ α_␈↓subsystem␈α
writer␈α
to␈α
gain␈α
complete␈α
control␈α
over␈α
the␈α
operation␈α
of␈α
MACLISP,␈α∞make␈α
it
␈↓ α_␈↓possible␈α∪to␈α∩hide␈α∪the␈α∪vagaries␈α∩of␈α∪MACLISP␈α∩from␈α∪the␈α∪naive␈α∩user␈α∪of␈α∪a␈α∩di≥erent
␈↓ α_␈↓subsystem,␈α∀and␈α∀provide␈α∪increased␈α∀e~ciency␈α∀in␈α∪memory␈α∀and␈α∀processor␈α∀usage␈α∪for
␈↓ α_␈↓heavily-used subsystems.
␈↓ α_␈↓β␈↓ ∧≥in the Multics implementation
␈↓ α_␈↓␈↓ αHThe␈α⊃MACLISP␈α⊃subsystem␈α⊃is␈α⊃entered␈α⊃by␈α⊃issuing␈α⊃the␈α⊃lisp␈α⊃command␈α⊃at␈α⊃Multics
␈↓ α_␈↓command␈α∞level.␈α∞ If␈α∂lisp␈α∞is␈α∞called␈α∂with␈α∞no␈α∞arguments,␈α∞a␈α∂copy␈α∞of␈α∞the␈α∂standard␈α∞initial
␈↓ α_␈↓environment␈α∂containing␈α∞all␈α∂the␈α∂system␈α∞functions␈α∂and␈α∂variables␈α∞is␈α∂made␈α∂the␈α∞current
␈↓ α_␈↓environment.␈α∃ If␈α∃the␈α∃lisp␈α∃command␈α∀is␈α∃issued␈α∃with␈α∃an␈α∃argument,␈α∃the␈α∀argument
␈↓ α_␈↓concatenated␈αwith␈α".sv.lisp"␈αis␈αthe␈αpathname␈αof␈αa␈αsaved␈αenvironment␈αwhich␈αis␈αcopied
␈↓ α_␈↓into␈α→the␈α→current␈α→environment.␈α~ This␈α→saved␈α→environment␈α→would␈α~contain␈α→some
␈↓ α_␈↓subsystem,␈α
which␈αwill␈α
receive␈α
control.␈α Additional␈α
arguments␈α
to␈αthe␈α
lisp␈α
command␈αin
␈↓ α_␈↓this case are actually arguments to the subsystem.
␈↓ α_␈↓␈↓ αHOften␈α∩one␈α∩constructs␈α∪a␈α∩trivial␈α∩command␈α∩for␈α∪getting␈α∩into␈α∩a␈α∪subsystem,␈α∩which
␈↓ α_␈↓simply calls the lisp command with the right arguments.
␈↓ α_␈↓␈↓ αHFor␈α≠instance,␈α≤the␈α≠lisp␈α≤compiler␈α≠subsystem␈α≠may␈α≤be␈α≠entered␈α≤through␈α≠the
␈↓ α_␈↓lisp←compiler␈α
command,␈αwhich␈α
calls␈αlisp␈α
with␈αthe␈α
pathname␈αof␈α
the␈αsaved␈α
environment
␈↓ α_␈↓containing␈α∀the␈α∀LISP␈α∪compiler␈α∀as␈α∀the␈α∪≡rst␈α∀argument,␈α∀and␈α∪the␈α∀arguments␈α∀to␈α∪the
␈↓ α_␈↓lisp←compiler command as the remaining arguments.
␈↓ α_␈↓␈↓ αHWhen␈αthe␈αstandard␈αinitial␈αenvironment␈α(i.e.␈αthe␈αordinary␈αMACLISP␈αsubsystem)␈αis
␈↓ α_␈↓entered,␈αit␈α
checks␈αfor␈α
a␈αsegment␈α
named␈αstart←up.lisp␈α
in␈αthe␈α
user's␈αhome␈α
directory.␈α If
␈↓ α_␈↓February 10, 1977␈↓ ε ␈↓∧∪3-1.7␈↓␈↓
↓Page 3-51
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓such␈α
a␈α
segment␈α
exists,␈α
it␈α
is␈α
read␈α
in,␈α
using␈α
the␈α
␈↓αload␈↓␈α
function.␈α
This␈α
facility␈α
allows␈α
users
␈↓ α_␈↓to "customize" LISP.
␈↓ α_␈↓β␈↓ ∧Cin the ITS implementation
␈↓ α_␈↓␈↓ αHLISP␈α∞may␈α∞be␈α∞entered␈α∞by␈α∞the␈α
:LISP␈α∞command.␈α∞ The␈α∞environment␈α∞set␈α∞up␈α∞by␈α
this
␈↓ α_␈↓command␈αis␈αthe␈αstandard␈αinitial␈αenvironment.␈α LISP␈αnow␈αgoes␈αthrough␈αan␈αallocation
␈↓ α_␈↓dialogue and optionally reads your .LISP. (INIT) ≡le. See for information on this.
␈↓ α_␈↓␈↓ αHLISP␈α∞may␈α∂be␈α∞entered␈α∞by␈α∂the␈α∞command␈α∂:LISP␈α∞name1␈α∞name2␈α∂dev␈α∞dir␈α∂where␈α∞dev
␈↓ α_␈↓and␈α∂dir␈α∂default␈α∂to␈α∞DSK␈α∂and␈α∂the␈α∂user's␈α∂directory,␈α∞respectively.␈α∂ In␈α∂this␈α∂case␈α∂the␈α∞≡le
␈↓ α_␈↓dev:dir;name1␈α∞name2␈α∞is␈α∞read␈α∞in␈α∞the␈α∞same␈α∞way␈α∞as␈α∞a␈α∞.LISP.␈α∞(INIT)␈α∞≡le.␈α∞ This␈α∞can␈α
be
␈↓ α_␈↓used to start up a subsystem.
␈↓ α_␈↓␈↓ αHIt␈αis␈αalso␈αpossible␈αto␈αbuild␈αa␈αsubsystem␈αin␈αa␈αLISP,␈αthen␈αsave␈αit␈αas␈αTS␈αFOO.␈α The
␈↓ α_␈↓:FOO command will now enter the subsystem, bypassing the allocation dialogue.
␈↓ α_␈↓␈↓ ∧≥␈↓βin the DEC-10 implementation␈↓
␈↓ α_␈↓␈↓ αHLISP␈αmay␈αbe␈αentered␈αby␈αthe␈αmonitor␈αcommand␈αR␈αLISP.␈α The␈αallocation␈αdialogue
␈↓ α_␈↓(see ) is entered. Optionally a LISP.INI in the user's directory may be read.
␈↓ α_␈↓␈↓ αHAs␈αin␈α
the␈αITS␈α
implementation,␈αa␈α
subsystem␈αcan␈α
be␈αsaved␈α
and␈αthen␈α
invoked␈αby␈α
the
␈↓ α_␈↓appropriate R or RUN command.
␈↓ α_␈↓␈↓β1.7.2 Saving an Environment␈↓
␈↓ α_␈↓␈↓ αHA␈α∩subsystem␈α∪is␈α∩constructed␈α∩by␈α∪the␈α∩following␈α∩procedure.␈α∪ One␈α∩starts␈α∪with␈α∩the
␈↓ α_␈↓ordinary␈α⊃MACLISP␈α⊂subsystem,␈α⊃and␈α⊂de≡nes␈α⊃a␈α⊂number␈α⊃of␈α⊂function␈α⊃de≡nitions␈α⊂and
␈↓ α_␈↓variable␈α
values.␈α∞ This␈α
creates␈α
an␈α∞␈↓↓environment␈↓␈α
which␈α
is␈α∞capable␈α
of␈α∞implementing␈α
the
␈↓ α_␈↓desired␈α_subsystem.␈α↔ This␈α_environment␈α_is␈α↔then␈α_saved␈α_in␈α↔a␈α_≡le,␈α_and␈α↔necessary
␈↓ α_␈↓mechanisms␈α⊂are␈α∂set␈α⊂up␈α∂so␈α⊂that␈α∂an␈α⊂operating-system␈α∂command␈α⊂can␈α∂invoke␈α⊂lisp␈α∂and
␈↓ α_␈↓cause␈αit␈αto␈αset␈αup␈αthe␈αenvironment␈αsaved␈αin␈αthe␈α≡le.␈α When␈αthe␈αsaved␈αenvironment␈αis
␈↓ α_␈↓invoked␈αcontrol␈αis␈α
passed␈αto␈αthe␈α
functions␈αin␈αit␈α
which␈αthen␈αproceed␈α
to␈αdo␈αthe␈α
business
␈↓ α_␈↓of the subsystem.
␈↓ α_␈↓␈↓ αHThe␈α⊗exact␈α⊗way␈α⊗of␈α↔saving␈α⊗the␈α⊗environment␈α⊗varies␈α⊗from␈α↔implementation␈α⊗to
␈↓ α_␈↓implementation. In the Multics implementation there is a function called ␈↓αsave␈↓:
␈↓ α_␈↓Page 3-52␈↓ ε∃␈↓∧∪3-1.7.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αsave␈↓ ∧XFSUBR␈↓
␈↓ α_␈↓␈↓ β_␈↓α(save␈αfoo)␈↓␈αsaves␈αthe␈αcurrent␈αLISP␈αenvironment␈αin␈αa␈α≡le␈αnamed␈αfoo.sv.lisp
␈↓ α_␈↓␈↓ αhin␈αthe␈αworking␈αdirectory.␈α ␈↓αfoo␈↓␈αis␈αnot␈αevaluated.␈α The␈αsaving␈αoperation␈αdestroys
␈↓ α_␈↓␈↓ αhthe␈α
working␈α
copy␈α
of␈αthe␈α
environment,␈α
so␈α
when␈αthe␈α
␈↓αsave␈↓␈α
is␈α
complete␈αlisp␈α
returns
␈↓ α_␈↓␈↓ αhto Multics command level.
␈↓ α_␈↓␈↓ β_All␈α
variable␈αvalues,␈α
≡le␈αobjects,␈α
array␈α
contents,␈αand␈α
function␈αde≡nitions␈α
(and
␈↓ α_␈↓␈↓ αhother␈α
properties)␈α
are␈α
saved,␈α
but␈α
the␈αcontents␈α
of␈α
the␈α
push␈α
down␈α
lists,␈αincluding
␈↓ α_␈↓␈↓ αhprevious␈α
values␈α∞of␈α
bound␈α
variables,␈α∞cannot␈α
be␈α
saved,␈α∞so␈α
␈↓αsave␈↓␈α
should␈α∞only␈α
be
␈↓ α_␈↓␈↓ αhused from top level.
␈↓ α_␈↓␈↓ αHIn the pdp-10 implementations there is a function called ␈↓αsuspend␈↓:
␈↓ α_␈↓␈↓αsuspend␈↓ ∧XLSUBR 0 or 1 args␈↓
␈↓ α_␈↓␈↓αsuspend␈↓␈α∂puts␈α∂LISP␈α∂in␈α∂a␈α∂state␈α∂such␈α∂that␈α∂it␈α∂can␈α∂be␈α∂:PDUMP'ed␈α∂(ITS)␈α∂or␈α∞SSAVE'd
␈↓ α_␈↓(DEC-10)␈αand␈αlater␈αrestarted.␈α
When␈αthe␈αsaved␈αcore␈α
image␈αis␈αrestarted,␈αeverything␈α
will
␈↓ α_␈↓be␈αthe␈α
same␈αas␈α
it␈αwas␈α
when␈αsuspended,␈α
and␈αcontrol␈α
will␈αreturn␈α
from␈αthe␈αinvocation␈α
of
␈↓ α_␈↓␈↓αsuspend␈↓.
␈↓ α_␈↓␈↓αsuspend␈↓␈αmay␈αbe␈αused␈αat␈αany␈αpoint␈αin␈αa␈αcomputation,␈αwith␈αthe␈αrestriction␈αthat␈αno␈αI/O
␈↓ α_␈↓devices other than the terminal may be in use.
␈↓ α_␈↓In␈α
the␈α
ITS␈α
implementation,␈αcare␈α
is␈α
taken␈α
so␈αthat␈α
all␈α
subsystems␈α
saved␈α
with␈α␈↓αsuspend␈↓
␈↓ α_␈↓from␈α
the␈α
same␈α
version␈α
of␈αLISP␈α
will␈α
share␈α
the␈α
pure␈αpages␈α
of␈α
LISP.␈α
In␈α
addition,␈αall
␈↓ α_␈↓invocations␈α∩of␈α∩a␈α∩particular␈α∩subsystem␈α∩will␈α⊃share␈α∩the␈α∩pure␈α∩pages␈α∩peculiar␈α∩to␈α⊃that
␈↓ α_␈↓subsystem.␈α∂ Declaration␈α∂of␈α∂data␈α⊂to␈α∂be␈α∂placed␈α∂in␈α∂pure␈α⊂pages␈α∂is␈α∂described␈α∂in␈α⊂a␈α∂later
␈↓ α_␈↓section.
␈↓ α_␈↓In␈αthe␈αDEC-10␈α
implementation,␈αcare␈αis␈α
taken␈αso␈αthat␈α
all␈αLISPs␈αand␈α
subsystems␈αsaved
␈↓ α_␈↓from␈α⊃LISP␈α⊃will␈α⊃share␈α⊃the␈α⊃same␈α∩high␈α⊃segment.␈α⊃ There␈α⊃is␈α⊃presently␈α⊃no␈α⊃way␈α∩for␈α⊃a
␈↓ α_␈↓subsystem to have its own high segment with additional shared material.
␈↓ α_␈↓After␈α␈↓αsuspend␈↓␈α
has␈αprepared␈αthe␈α
LISP␈αcore-image␈αfor␈α
dumping,␈αit␈αreturns␈α
control␈αto
␈↓ α_␈↓the operating system so that it can be dumped.
␈↓ α_␈↓If␈α∞␈↓αsuspend␈↓␈α∂is␈α∞given␈α∞an␈α∂argument,␈α∞that␈α∞argument␈α∂is␈α∞␈↓αexplodec␈↓'ed␈α∞and␈α∂the␈α∞resulting
␈↓ α_␈↓character␈αstring␈αis␈αpassed␈αback␈αto␈αthe␈αoperating␈αsystem␈αas␈αa␈αcommand.␈α (This␈αdoesn't
␈↓ α_␈↓currently work in the DEC-10 implementation.)
␈↓ α_␈↓Commonly one will write a setup routine for a subsystem like this:
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.7.2␈↓␈↓ ⎇Page 3-53
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓α␈↓ αh(progn
␈↓ α_␈↓α␈↓ αh (terpri)
␈↓ α_␈↓α␈↓ αh (princ 'options:)
␈↓ α_␈↓α␈↓ αh ... read in options ...
␈↓ α_␈↓α␈↓ αh (terpri)
␈↓ α_␈↓α␈↓ αh (princ 'loading)
␈↓ α_␈↓α␈↓ αh ... load in ≡les of functions ...
␈↓ α_␈↓α␈↓ αh (suspend)
␈↓ α_␈↓α␈↓ αh (start-the-subsystem)
␈↓ α_␈↓α␈↓ αh))
␈↓ α_␈↓The␈α∂subsystem's␈α∂environment␈α∂is␈α∂now␈α∂ready␈α∂for␈α∂dumping.␈α∂ Alternatively,␈α∂one␈α∞might
␈↓ α_␈↓write
␈↓ α_␈↓α␈↓ αh(suspend ':PDUMP/ TS/ NSUBSYS/
␈↓ α_␈↓α␈↓ αh:$ALL/ DONE$/
␈↓ α_␈↓α␈↓ αh)
␈↓ α_␈↓which will do the dump itself and print a message when done.
␈↓ α_␈↓␈↓β1.7.3 Gaining and Keeping Control␈↓
␈↓ α_␈↓␈↓ αHIn␈α
the␈αMultics␈α
implementation,␈α
when␈αa␈α
saved␈α
environment␈αis␈α
restarted␈α
it␈αlooks␈α
like
␈↓ α_␈↓an␈α
error␈αthat␈α
returns␈α
to␈αtop␈α
level.␈α
The␈αforms␈α
in␈α
the␈α␈↓αerrlist␈↓␈α
are␈α
evaluated.␈α These
␈↓ α_␈↓forms␈αshould␈α
do␈αwhatever␈α
is␈αnecessary␈α
to␈αstart␈α
up␈αthe␈α
subsystem.␈α The␈α
arguments␈αto
␈↓ α_␈↓the␈α∞command␈α∞which␈α∞invoked␈α∞the␈α∞subsystem␈α∞may␈α∞be␈α∞obtained␈α∞via␈α∞␈↓α(status␈α∞arg)␈↓␈α∞or
␈↓ α_␈↓␈↓α(status jcl)␈↓.
␈↓ α_␈↓␈↓ αHIn␈α
the␈α
pdp-10␈α
implementations,␈α
when␈α
a␈α
saved␈α
environment␈α
is␈α∞restarted␈α
execution
␈↓ α_␈↓continues␈α
from␈α
the␈α
point␈α
where␈α
␈↓αsuspend␈↓␈α
was␈α
called.␈α
The␈α
next␈α
form␈α
evaluated␈α
should
␈↓ α_␈↓do␈α
whatever␈α
is␈α
necessary␈α
to␈α
start␈α∞up␈α
the␈α
subsystem.␈α
In␈α
the␈α
ITS␈α∞implementation,␈α
the
␈↓ α_␈↓arguments␈α∞of␈α
the␈α∞command␈α
line␈α∞which␈α
invoked␈α∞the␈α
subsystem␈α∞may␈α
be␈α∞obtained␈α
via
␈↓ α_␈↓␈↓α(status jcl)␈↓.
␈↓ α_␈↓␈↓ αHIf␈αthe␈αsubsystem␈αwants␈αto␈αhide␈αthe␈αunderlying␈αMACLISP␈αfrom␈αthe␈αuser,␈αit␈αhas␈αa
␈↓ α_␈↓number␈α∞of␈α∞facilities␈α
available.␈α∞ By␈α∞setting␈α
up␈α∞its␈α∞own␈α
user-interrupt␈α∞handlers␈α∞it␈α
can
␈↓ α_␈↓handle␈αany␈αLISP␈αerrors␈αwhich␈αoccur␈αitself.␈α It␈αcan␈αreplace␈αthe␈αMACLISP␈αinterpretive
␈↓ α_␈↓interaction␈α_loop␈α_with␈α_its␈α_own␈α_by␈α_using␈α_␈↓α(sstatus␈α_toplevel)␈↓␈α_and␈α↔␈↓α(sstatus
␈↓ α_␈↓αbreaklevel)␈↓.␈α It␈αcan␈α
also␈αprovide␈αa␈αtotally-di≥erent␈α
interaction␈αloop␈αby␈αnot␈α
returning
␈↓ α_␈↓Page 3-54␈↓ ε∃␈↓∧∪3-1.7.2␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓control␈αto␈αthe␈αlisp␈αtop␈αlevel␈αwhen␈αit␈αis␈αstarted,␈αbut␈αinstead␈αretaining␈αcontrol␈αin␈αits␈αown
␈↓ α_␈↓functions which read and respond to user input.
␈↓ α_␈↓␈↓ αHIt␈α
is␈α
possible␈αfor␈α
a␈α
subsystem␈αto␈α
retain␈α
the␈α
trappings␈αof␈α
MACLISP␈α
but␈αchange␈α
the
␈↓ α_␈↓way␈α∩things␈α⊃read␈α∩and␈α⊃print.␈α∩ Macro␈α⊃characters␈α∩and␈α⊃the␈α∩readtable␈α⊃can␈α∩be␈α∩used␈α⊃to
␈↓ α_␈↓change␈α∂the␈α∂way␈α⊂input␈α∂is␈α∂parsed.␈α⊂ All␈α∂output␈α∂by␈α⊂MACLISP␈α∂(with␈α∂the␈α⊂exception␈α∂of
␈↓ α_␈↓character-string␈α⊂messages)␈α⊂is␈α∂done␈α⊂through␈α⊂the␈α∂function␈α⊂␈↓αprin1␈↓,␈α⊂and␈α⊂the␈α∂subsystem
␈↓ α_␈↓may␈α
rede≡ne␈αthis␈α
function.␈α In␈α
the␈α
Mutlics␈αimplementation␈α
one␈αsimply␈α
rede≡nes␈αit,␈α
but
␈↓ α_␈↓in␈α⊂the␈α∂pdp-10␈α⊂implementations␈α∂the␈α⊂variable␈α⊂␈↓αprin1␈↓␈α∂must␈α⊂be␈α∂bound␈α⊂to␈α⊂the␈α∂function
␈↓ α_␈↓which is to substitute for ␈↓αprin1␈↓.
␈↓ α_␈↓␈↓ αHSome␈α
subsystems␈αdon't␈α
do␈αany␈α
of␈αthis,␈α
but␈αsimply␈α
consist␈αof␈α
standard␈αMACLISP
␈↓ α_␈↓augmented␈αby␈αsome␈αadditional␈αfunctions␈αwhich␈αmay␈αbe␈αused␈αin␈αforms␈αtyped␈αin␈αat␈α
top
␈↓ α_␈↓level.
␈↓ α_␈↓␈↓β1.7.4 Purity␈↓
␈↓ α_␈↓␈↓ αHIn␈αthe␈αpdp-10␈αimplementations,␈αthere␈αare␈αsome␈αfacilities␈αwhich␈αallow␈αsubsystems␈αto
␈↓ α_␈↓put␈α∞their␈α∞non-changing␈α∞data,␈α∞function␈α∞de≡nitions,␈α∞binary␈α∞code,␈α∞etc.␈α∞into␈α∞pure␈α
pages.
␈↓ α_␈↓This␈α
decreases␈α
the␈α
load␈α∞on␈α
memory␈α
by␈α
sharing␈α∞pages␈α
between␈α
multiple␈α
users␈α∞of␈α
the
␈↓ α_␈↓same subsystem. (This applies only to implementations with the "Bibop" feature.)
␈↓ α_␈↓␈↓ αHThere␈α∞are␈α
some␈α∞extra␈α
storage␈α∞spaces␈α∞which␈α
are␈α∞used␈α
to␈α∞store␈α∞pure␈α
(unchanging)
␈↓ α_␈↓LISP␈α
objects.␈α
These␈α
are␈α
the␈α
pure␈α
list,␈α
pure␈α
≡xnum,␈α
pure␈α
∨onum,␈α
and␈α
pure␈α
bignum
␈↓ α_␈↓spaces.
␈↓ α_␈↓␈↓αpurcopy␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_This␈α∞function␈α∞makes␈α∞and␈α∞returns␈α∞a␈α∞copy␈α∞of␈α∞its␈α∞argument␈α∞in␈α∞pure␈α∞storage.
␈↓ α_␈↓␈↓ αhThis␈αis␈αprimarily␈αof␈αuse␈αin␈α
the␈αcreation␈αof␈αlarge␈αsharable␈αsystems␈αlike␈α
macsyma.
␈↓ α_␈↓␈↓ αhIn␈α
implementations␈αother␈α
than␈α
Bibop␈αpdp-10␈α
implementations,␈α
␈↓αpurcopy␈↓␈αsimply
␈↓ α_␈↓␈↓ αhreturns its argument.
␈↓ α_␈↓␈↓ β_There␈α∀are␈α∀a␈α∪number␈α∀of␈α∀features␈α∀which␈α∪control␈α∀how␈α∀binary␈α∀code␈α∪and
␈↓ α_␈↓␈↓ αhconstants are puri≡ed when a compiled program is loaded into lisp.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.7.3␈↓␈↓ ⎇Page 3-55
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αbporg␈↓␈↓ ∧XVARIABLE
␈↓ α_␈↓␈↓ β_The␈αvalue␈αof␈α␈↓αbporg␈↓␈αshould␈αalways␈αbe␈αa␈α≡xnum,␈αwhose␈αvalue␈αis␈αthe␈αaddress
␈↓ α_␈↓␈↓ αhof␈αthe␈α
≡rst␈αunused␈α
word␈αof␈αbinary␈α
program␈αspace.␈α
This␈αvalue␈αgenerally␈α
should
␈↓ α_␈↓␈↓ αhnot␈α∂be␈α⊂altered␈α∂by␈α⊂the␈α∂user,␈α∂but␈α⊂only␈α∂examined.␈α⊂ ␈↓αbporg␈↓␈α∂is␈α⊂updated␈α∂whenever
␈↓ α_␈↓␈↓ αhbinary code is loaded by ␈↓αlap␈↓ or ␈↓αfasload␈↓.
␈↓ α_␈↓␈↓αbpend␈↓␈↓ ∧X*** VARIABLE
␈↓ α_␈↓␈↓ β_This␈αvariable␈αshould␈α
also␈αalways␈αhave␈αa␈α
≡xnum␈αas␈αits␈αvalue;␈α
this␈αindicates
␈↓ α_␈↓␈↓ αhthe␈α≡rst␈αaddress␈αabove␈αthe␈α
last␈αavailable␈αword␈αof␈αbinary␈αprogram␈α
space.␈α This
␈↓ α_␈↓␈↓ αhis␈α∂updated␈α∂by␈α∂many␈α∂internal␈α⊂lisp␈α∂routines,␈α∂such␈α∂as␈α∂the␈α∂garbage␈α⊂collector,␈α∂the
␈↓ α_␈↓␈↓ αharray allocator, and ␈↓αlap␈↓ and ␈↓αfasload␈↓.
␈↓ α_␈↓␈↓αpagebporg␈↓␈↓ ∧XSUBR no args
␈↓ α_␈↓␈↓ β_Causes␈α∞the␈α
variable␈α∞␈↓αbporg␈↓␈α
to␈α∞be␈α
adjusted␈α∞upwards␈α
so␈α∞as␈α
to␈α∞lie␈α
on␈α∞a␈α
page
␈↓ α_␈↓␈↓ αhboundary.␈α This␈α
is␈αprincipally␈αuseful␈α
on␈αITS␈αin␈α
conjunction␈αwith␈α
the␈αfunction
␈↓ α_␈↓␈↓ αh␈↓αpurify␈↓. ␈↓αpagebporg␈↓ returns the new value of ␈↓αbporg␈↓.
␈↓ α_␈↓␈↓αpurify␈↓␈↓ ∧XSUBR 3 args
␈↓ α_␈↓␈↓ β_The␈α≡rst␈αtwo␈αarguments␈αto␈α␈↓αpurify␈↓␈αshould␈αbe␈α≡xnums,␈αand␈αdelimit␈αa␈αrange
␈↓ α_␈↓␈↓ αhof␈αmemory␈α
within␈αthe␈α
lisp␈αsystem.␈α
The␈αthird␈α
argument␈αis␈α
a␈α∨ag.␈α
If␈αit␈α
is␈α␈↓αnil␈↓,
␈↓ α_␈↓␈↓ αhthen␈αthe␈αpages␈αcovered␈αby␈αthe␈αspeci≡ed␈αrange␈αof␈αmemory␈αare␈αmade␈αimpure,␈αi.e.
␈↓ α_␈↓␈↓ αhwritable.␈α If␈α
it␈αis␈α
␈↓αt␈↓,␈αthen␈α
the␈αpages␈αare␈α
made␈αpure,␈α
i.e.␈αread-only␈α
and␈αsharable.
␈↓ α_␈↓␈↓ αhIf␈αit␈αis␈α␈↓αbporg␈↓,␈αthen␈αthe␈αpages␈αare␈αalso␈αmade␈αpure,␈αbut␈αin␈αaddition␈αsome␈αwork␈αis
␈↓ α_␈↓␈↓ αhdone␈αto␈αmake␈αsure␈α
that␈αno␈α␈↓αUUO␈↓␈αon␈αthose␈α
pages␈αmay␈αever␈αbe␈α
"clobbered".␈α This
␈↓ α_␈↓␈↓ αhoption␈αshould␈αalways␈αbe␈αused␈αif␈αthe␈αpages␈αinvolved␈αcontain␈αbinary␈αcode␈αloaded
␈↓ α_␈↓␈↓ αhby␈α≡␈↓αlap␈↓␈α≥or␈α≡␈↓αfasload␈↓.␈α≥ Presently␈α≡␈↓αpurify␈↓␈α≥does␈α≡nothing␈α≥in␈α≡the␈α≥dec-10
␈↓ α_␈↓␈↓ αhimplementation;␈α⊂it␈α⊂is␈α∂intended␈α⊂primarily␈α⊂for␈α∂producing␈α⊂systems␈α⊂built␈α⊂on␈α∂lisp,
␈↓ α_␈↓␈↓ αhsuch␈αas␈αMacsyma,␈αin␈αsuch␈αa␈αway␈αthat␈αpure␈αpages␈αcan␈αbe␈αshared␈αbetween␈αusers.
␈↓ α_␈↓␈↓ αhExample:␈α∂The␈α∂following␈α∂sequence␈α∂of␈α∂commands␈α∂might␈α∂be␈α∂used␈α∂to␈α∂produce␈α∞a
␈↓ α_␈↓␈↓ αhsharable system on ITS:
␈↓ α_␈↓Page 3-56␈↓ ε∃␈↓∧∪3-1.7.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓α␈↓ βH(setq lopage (pagebporg)) ␈↓;save low page address␈↓α
␈↓ α_␈↓α␈↓ βH(setq pure t) ␈↓;speci≡es pure code␈↓α
␈↓ α_␈↓α␈↓ βH(fasload funny fasl) ␈↓;load up system␈↓α
␈↓ α_␈↓α␈↓ βH(fasload weird fasl)
␈↓ α_␈↓α␈↓ βH(uread some lap)
␈↓ α_␈↓α␈↓ βH ...
␈↓ α_␈↓α␈↓ βH(setq errlist '((terpri) ␈↓;stu≥ for system startup␈↓α
␈↓ α_␈↓α␈↓ βH (princ 'welcome/ to/ supersystem/!)
␈↓ α_␈↓α␈↓ βH (terpri)))
␈↓ α_␈↓α␈↓ βH(sstatus toplevel ␈↓;set up top level for system␈↓α
␈↓ α_␈↓α␈↓ βH '(top-handler))
␈↓ α_␈↓α␈↓ βH(setq hipage (pagebporg)) ␈↓;save high page address␈↓α
␈↓ α_␈↓α␈↓ βH(purify lopage (1- hipage) 'bporg) ␈↓;purify pages␈↓α
␈↓ α_␈↓α␈↓ βH(suspend ':pdump/ sys:ts/ super/↑M) ␈↓;tell ddt to dump␈↓α
␈↓ α_␈↓α␈↓ βH(err) ␈↓;run errlist
␈↓ α_␈↓␈↓αpure␈↓␈↓ ∧XVARIABLE
␈↓ α_␈↓␈↓ β_This␈α∂variable,␈α∂initially␈α⊂␈↓αnil␈↓,␈α∂should␈α∂be␈α∂made␈α⊂non-␈↓αnil␈↓␈α∂by␈α∂the␈α⊂user␈α∂before
␈↓ α_␈↓␈↓ αhloading␈αbinary␈αcode␈αwhich␈αis␈αto␈αbe␈αmade␈αpure.␈α It␈αsignals␈α␈↓αlap␈↓␈αand␈α␈↓αfasload␈↓␈αto
␈↓ α_␈↓␈↓ αhbe␈α∩circumspect␈α∩about␈α⊃any␈α∩␈↓αUUO␈↓'s␈α∩in␈α⊃the␈α∩code,␈α∩because␈α⊃pure␈α∩␈↓αUUO␈↓'s␈α∩cannot␈α⊃be
␈↓ α_␈↓␈↓ αhclobbered␈α
to␈α
be␈α
␈↓αPUSHJ␈↓'s␈α
or␈α∞␈↓αJRST␈↓'s.␈α
␈↓αlap␈↓␈α
solves␈α
this␈α
problem␈α
by␈α∞clobbering␈α
the
␈↓ α_␈↓␈↓ αh␈↓αUUO␈↓␈α∂immediately␈α∂if␈α∂the␈α∞referenced␈α∂function␈α∂is␈α∂already␈α∞de≡ned␈α∂and␈α∂is␈α∂itself␈α∞a
␈↓ α_␈↓␈↓ αhsubr␈α
rather␈α
than␈α
an␈α
expr;␈α
otherwise␈α
the␈α
␈↓αUUO␈↓␈α
is␈α
made␈α
permanently␈α
unclobberable
␈↓ α_␈↓␈↓ αh(i.e. ␈↓αCALL␈↓ is converted to ␈↓αCALLF␈↓, etc.).
␈↓ α_␈↓␈↓ β_␈↓αfasload␈↓␈α↔is␈α↔somewhat␈α↔more␈α↔clever:␈α↔it␈α↔too␈α↔tries␈α↔to␈α↔clobber␈α_each␈α↔␈↓αUUO␈↓
␈↓ α_␈↓␈↓ αhimmediately,␈α⊃but␈α⊃if␈α⊃it␈α⊃can't␈α⊃it␈α⊃puts␈α⊃the␈α⊃address␈α⊃of␈α⊃the␈α⊃␈↓αUUO␈↓␈α⊃on␈α⊃a␈α∩list␈α⊃called
␈↓ α_␈↓␈↓ αh␈↓αpurclobrl␈↓,␈αwhich␈αis␈αchecked␈αat␈αthe␈αend␈αof␈αeach␈αcall␈αto␈α␈↓αfasload␈↓,␈αand␈αeach␈α␈↓αUUO␈↓
␈↓ α_␈↓␈↓ αhon␈α⊃the␈α⊃list␈α⊃is␈α⊃clobbered␈α⊃at␈α⊂that␈α⊃time,␈α⊃if␈α⊃the␈α⊃appropriate␈α⊃function␈α⊃had␈α⊂been
␈↓ α_␈↓␈↓ αhloaded␈α∞by␈α∞that␈α∞call␈α∞to␈α∞␈↓αfasload␈↓.␈α∞ If␈α∞the␈α∞function␈α∞never␈α∞does␈α∞get␈α∂de≡ned,␈α∞then
␈↓ α_␈↓␈↓ αh␈↓αpurify␈↓␈α⊂will␈α∂also␈α⊂check␈α⊂␈↓αpurclobrl␈↓␈α∂and␈α⊂convert␈α⊂each␈α∂␈↓αUUO␈↓␈α⊂to␈α⊂its␈α∂permanently
␈↓ α_␈↓␈↓ αhunclobberable form.
␈↓ α_␈↓␈↓ β_If␈α∂␈↓αpure␈↓␈α⊂has␈α∂a␈α∂≡xnum␈α⊂as␈α∂its␈α⊂value,␈α∂then␈α∂␈↓αfasload␈↓␈α⊂(but␈α∂not␈α⊂␈↓αlap␈↓)␈α∂behaves
␈↓ α_␈↓␈↓ αhsomewhat␈αdi≥erently.␈α If␈αthe␈αvalue␈αof␈α␈↓αpure␈↓␈α(which␈αmust␈αbe␈αbetween␈α1␈αand␈α8␈αor
␈↓ α_␈↓␈↓ αhso)␈α
is,␈αsay,␈α
3,␈αthen␈α
␈↓αfasload␈↓␈αcalls␈α
␈↓αpagebporg␈↓,␈αand␈α
then␈αreserves␈α
6=2*3␈α
pages␈αof
␈↓ α_␈↓␈↓ αhbinary␈α
program␈α
space,␈α
unless␈α
a␈α
previous␈α
call␈α
to␈α
␈↓αfasload␈↓␈α
has␈α
already␈α
reserved
␈↓ α_␈↓␈↓ αhthem␈α(i.e.␈αthey␈αare␈αreserved␈αonly␈αonce).␈α Thus␈α␈↓αfasload␈↓␈αhas␈αtwo␈αsets␈αof␈α3␈αpages
␈↓ α_␈↓␈↓ αhto␈α
work␈α
with;␈α
we␈α
shall␈α
call␈α
the␈α
≡rst␈α
set␈α
"area␈α
1"␈α
and␈α
the␈α
second␈α
set␈α
"area␈α
2".␈α
Now
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.7.4␈↓␈↓ ⎇Page 3-57
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αhwhenever␈α∞␈↓αfasload␈↓␈α∂has␈α∞to␈α∞load␈α∂a␈α∞clobberable␈α∞␈↓αUUO␈↓,␈α∂it␈α∞does␈α∞not␈α∂place␈α∞it␈α∂in␈α∞the
␈↓ α_␈↓␈↓ αhcode␈α∂being␈α∞loaded,␈α∂but␈α∞rather␈α∂hashes␈α∞it␈α∂and␈α∂places␈α∞it␈α∂in␈α∞area␈α∂1␈α∞if␈α∂it␈α∂was␈α∞not
␈↓ α_␈↓␈↓ αhthere␈αalready;␈α
a␈αcopy␈α
is␈αplaced␈α
in␈αthe␈α
same␈αrelative␈α
position␈αin␈α
area␈α2.␈α Then␈α
an
␈↓ α_␈↓␈↓ αh␈↓αXCT␈↓␈α⊂instruction␈α⊃pointing␈α⊂to␈α⊂the␈α⊃␈↓αUUO␈↓␈α⊂in␈α⊂area␈α⊃1␈α⊂is␈α⊂placed␈α⊃in␈α⊂the␈α⊃binary␈α⊂code.
␈↓ α_␈↓␈↓ αhWhen all loading has been done, area 2 may be puri≡ed, but area 1 may not.
␈↓ α_␈↓␈↓ β_Now␈α⊂when␈α⊂running␈α⊂the␈α⊂code,␈α⊂the␈α⊃␈↓αUUO␈↓'s␈α⊂pointed␈α⊂to␈α⊂by␈α⊂the␈α⊂␈↓αXCT␈↓'s␈α⊃may␈α⊂be
␈↓ α_␈↓␈↓ αhclobbered␈α
(the␈α
pdp-10␈α
lisp␈α
␈↓αUUO␈↓␈α
handler␈αis␈α
clever␈α
about␈α
␈↓αXCT␈↓),␈α
and␈α
the␈α
code␈αwill
␈↓ α_␈↓␈↓ αhrun␈α⊃faster␈α⊃the␈α⊃second␈α⊃time␈α⊃around␈α⊃because␈α⊃the␈α⊃␈↓αXCT␈↓'s␈α⊃will␈α⊃point␈α∩to␈α⊃␈↓αPUSHJ␈↓'s.
␈↓ α_␈↓␈↓ αhHowever,␈α∂if␈α⊂␈↓α(sstatus␈α∂uuolinks)␈↓␈α⊂is␈α∂called,␈α∂then␈α⊂area␈α∂2␈α⊂is␈α∂copied␈α⊂back␈α∂into
␈↓ α_␈↓␈↓ αharea␈α
1,␈α
e≥ectively␈αunclobbering␈α
all␈α
the␈α
␈↓αUUO␈↓'s.␈α Naturally,␈α
an␈α
area␈α
large␈αenough␈α
to
␈↓ α_␈↓␈↓ αhcontain␈α∪all␈α∪the␈α∪␈↓αUUO␈↓'s␈α∪should␈α∪be␈α∪reserved;␈α∪␈↓α(status␈α∪uuolinks)␈↓␈α∪(q.v.)␈α∪yields
␈↓ α_␈↓␈↓ αhinformation relevant to this.
␈↓ α_␈↓␈↓ β_Thus␈α∀the␈α∀example␈α∀given␈α∀under␈α∀the␈α∀␈↓αpurify␈↓␈α∀function␈α∀above␈α∀might␈α∀be
␈↓ α_␈↓␈↓ αhmodi≡ed as follows:
␈↓ α_␈↓α␈↓ βH(setq lopage (pagebporg)) ␈↓;save low page address␈↓α
␈↓ α_␈↓α␈↓ βH(setq pure 3) ␈↓;speci≡es pure code␈↓α
␈↓ α_␈↓α␈↓ βH(setq lopage (+ lopage 6000)) ␈↓;allow for area 1␈↓α
␈↓ α_␈↓α␈↓ βH(fasload funny fasl) ␈↓;load up system␈↓α
␈↓ α_␈↓α␈↓ βH(fasload weird fasl)
␈↓ α_␈↓α␈↓ βH(uread some lap)
␈↓ α_␈↓α␈↓ βH ...
␈↓ α_␈↓α␈↓ βH(setq errlist '((terpri) ␈↓;stu≥ for system startup␈↓α
␈↓ α_␈↓α␈↓ βH (princ 'welcome/ to/ supersystem/!)
␈↓ α_␈↓α␈↓ βH (terpri)))
␈↓ α_␈↓α␈↓ βH(sstatus toplevel ␈↓;set up top level for system␈↓α
␈↓ α_␈↓α␈↓ βH '(top-handler))
␈↓ α_␈↓α␈↓ βH(setq hipage (pagebporg)) ␈↓;save high page address␈↓α
␈↓ α_␈↓α␈↓ βH(purify lopage (1- hipage) 'bporg) ␈↓;purify pages␈↓α
␈↓ α_␈↓α␈↓ βH(suspend ':pdump/ sys:ts/ super/↑M) ␈↓;tell ddt to dump␈↓α
␈↓ α_␈↓α␈↓ βH(err) ␈↓;run errlist
␈↓ α_␈↓␈↓α*pure␈↓␈↓ ∧XVARIABLE
␈↓ α_␈↓␈↓ β_This␈α∂variable␈α∂controls␈α∂automatic␈α∂puri≡cation␈α∂of␈α∂S-expressions␈α∂and␈α∞atomic
␈↓ α_␈↓␈↓ αhsymbols.␈α
If␈α
it␈α
is␈α∞set␈α
non-␈↓αnil␈↓␈α
(the␈α
initial␈α
value␈α∞is␈α
␈↓αnil␈↓),␈α
then␈α
the␈α∞following␈α
are
␈↓ α_␈↓␈↓ αhplaced␈α⊂in␈α⊃pure␈α⊂storage␈α⊂spaces␈α⊃instead␈α⊂of␈α⊂regular␈α⊃storage␈α⊂spaces:␈α⊃ pnames␈α⊂of
␈↓ α_␈↓␈↓ αhatomic␈αsymbols;␈αlist,␈α
≡xnum,␈α∨onum,␈αand␈αbignum␈α
constants␈αused␈αby␈αcode␈α
loaded
␈↓ α_␈↓␈↓ αhwith␈α␈↓αfasload␈↓;␈αproperties␈αwhose␈αindicators␈αare␈αin␈αthe␈αlist␈αwhich␈αis␈αthe␈αvalue␈αof
␈↓ α_␈↓␈↓ αhthe variable ␈↓αputprop␈↓ (initially ␈↓αsubr␈↓, ␈↓αfsubr␈↓, and ␈↓αlsubr␈↓).
␈↓ α_␈↓Page 3-58␈↓ ε∃␈↓∧∪3-1.7.4␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αpurclobrl␈↓␈↓ ∧XVARIABLE
␈↓ α_␈↓␈↓ β_Used␈α⊃by␈α∩␈↓αfasload␈↓␈α⊃to␈α⊃keep␈α∩track␈α⊃of␈α⊃␈↓αUUO␈↓'s␈α∩which␈α⊃are␈α⊃potentially␈α∩but␈α⊃not
␈↓ α_␈↓␈↓ αhimmediately clobberable.
␈↓ α_␈↓␈↓ β_The␈α␈↓αputprop␈↓␈α
and␈α␈↓αremprop␈↓␈α
functions␈αknow␈α
about␈αpuri≡ed␈α
property␈αlists.␈α
If
␈↓ α_␈↓␈↓ αhnecessary,␈α∂they␈α∂will␈α∂copy␈α∂the␈α∂property␈α∂list␈α∂(but␈α∂not␈α∂the␈α∂properties␈α∂themselves)
␈↓ α_␈↓␈↓ αhinto non pure storage so that it can be modi≡ed.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.7.4␈↓␈↓ |Page 3-59
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓β1.8 Miscellaneous Functions␈↓
␈↓ α_␈↓␈↓β1.8.1 The Status Functions␈↓
␈↓ α_␈↓␈↓αstatus␈↓ ∧XFSUBR␈↓
␈↓ α_␈↓␈↓ αHThe␈α
␈↓αstatus␈↓␈α
special␈α
form␈α
is␈α
used␈α
to␈α
get␈α
the␈α
value␈α
of␈α
various␈α∞system␈α
parameters.
␈↓ α_␈↓Its␈α∞≡rst␈α∞argument,␈α∞not␈α∞evaluated,␈α∞is␈α∞an␈α∞atomic␈α∞symbol␈α∞indicating␈α∞which␈α∞of␈α∞its␈α
many
␈↓ α_␈↓functions␈α⊃␈↓αstatus␈↓␈α⊃should␈α⊃perform.␈α⊃ The␈α⊃use␈α⊃of␈α⊃additional␈α⊃arguments␈α∩depends␈α⊃on
␈↓ α_␈↓what␈α⊗the␈α⊗≡rst␈α⊗argument␈α⊗is.␈α⊗ These␈α⊗arguments␈α⊗may␈α⊗or␈α⊗may␈α⊗not␈α⊗be␈α⊗evaluated,
␈↓ α_␈↓depending␈α⊃on␈α∩the␈α⊃≡rst␈α∩argument.␈α⊃ If␈α∩certain␈α⊃additional␈α∩arguments␈α⊃are␈α∩omitted,␈α⊃a
␈↓ α_␈↓default␈αvalue,␈αusually␈α
␈↓αnil␈↓␈αis␈αsupplied,␈α
again␈αdepending␈αon␈α
what␈αthe␈α≡rst␈αargument␈α
is.
␈↓ α_␈↓The various status functions are listed below.
␈↓ α_␈↓␈↓αsstatus␈↓ ∧XFSUBR␈↓
␈↓ α_␈↓␈↓ β_The␈α∪␈↓αsstatus␈↓␈α∪special␈α∪form␈α∪is␈α∪used␈α∩to␈α∪set␈α∪the␈α∪value␈α∪of␈α∪various␈α∩system
␈↓ α_␈↓␈↓ αhparameters. Its arguments are similar to those of ␈↓αstatus␈↓.
␈↓ α_␈↓These are the things that you can do with ␈↓αstatus␈↓ and ␈↓αsstatus␈↓:
␈↓ α_␈↓STATUS FUNCTIONS FOR I/O
␈↓ α_␈↓␈↓αtabsize␈↓␈↓ β8␈↓α(status␈α∂tabsize)␈↓␈α∂returns␈α⊂the␈α∂number␈α∂of␈α∂character␈α⊂positions␈α∂assumed
␈↓ α_␈↓␈↓ β8between tab stops, which depends on the implementation.
␈↓ α_␈↓␈↓αnewline␈↓␈↓ β8␈↓α(status␈α⊃newline)␈↓␈α∩returns␈α⊃a␈α∩≡xnum␈α⊃which␈α∩is␈α⊃the␈α∩ascii␈α⊃code␈α∩for␈α⊃the
␈↓ α_␈↓␈↓ β8character␈α⊃which␈α⊃marks␈α⊃the␈α⊃end␈α∩of␈α⊃a␈α⊃line␈α⊃of␈α⊃input.␈α⊃ For␈α∩example,␈α⊃␈↓α(=
␈↓ α_␈↓α␈↓ β8(setq ch (tyi)) (status newline))␈↓
␈↓ α_␈↓␈↓αcharmode␈↓␈↓ β8␈↓α(status␈α⊂charmode␈α⊂␈↓↓f␈↓α)␈↓␈α⊂returns␈α⊃the␈α⊂value␈α⊂of␈α⊂the␈α⊃character-mode␈α⊂switch
␈↓ α_␈↓␈↓ β8for␈α∩the␈α∩≡le␈α⊃␈↓↓f␈↓.␈α∩ If␈α∩␈↓↓f␈↓␈α⊃is␈α∩␈↓αt␈↓␈α∩or␈α⊃omitted␈α∩the␈α∩terminal␈α⊃is␈α∩assumed.␈α∩ If␈α⊃the
␈↓ α_␈↓␈↓ β8character-mode␈α∞switch␈α∞is␈α∞␈↓αt␈↓␈α∞(the␈α∂normal␈α∞case␈α∞for␈α∞the␈α∞terminal)␈α∂output␈α∞is
␈↓ α_␈↓␈↓ β8sent␈α∞to␈α∂the␈α∞device␈α∞as␈α∂soon␈α∞as␈α∞it␈α∂is␈α∞generated.␈α∞ If␈α∂the␈α∞switch␈α∞is␈α∂␈↓αnil␈↓␈α∞(the
␈↓ α_␈↓␈↓ β8normal␈α∩case␈α∩for␈α∩≡les␈α⊃other␈α∩than␈α∩the␈α∩terminal)␈α⊃output␈α∩is␈α∩held␈α∩until␈α⊃a
␈↓ α_␈↓␈↓ β8newline␈α
is␈α
typed,␈α
an␈α
error␈α
occurs,␈α
input␈α
is␈α
requested,␈α
or␈α
the␈αbu≥er␈α
becomes
␈↓ α_␈↓␈↓ β8full.␈α⊃ (You␈α⊂can␈α⊃also␈α⊃cause␈α⊂the␈α⊃bu≥er␈α⊂to␈α⊃be␈α⊃sent␈α⊂by␈α⊃using␈α⊃the␈α⊂␈↓αforce-
␈↓ α_␈↓α␈↓ β8output␈↓␈α∂function.)␈α⊂This␈α∂provides␈α⊂increased␈α∂e~ciency␈α∂at␈α⊂the␈α∂cost␈α⊂of␈α∂not
␈↓ α_␈↓␈↓ β8immediately seeing all output in some cases.
␈↓ α_␈↓Page 3-60␈↓ ε ␈↓∧∪3-1.8␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α∞charmode␈α
␈↓↓x␈α∞f␈↓α)␈↓␈α
sets␈α∞the␈α
character-mode␈α∞switch␈α
of␈α∞the␈α
≡le␈α∞␈↓↓f␈↓␈α
(␈↓↓f␈↓
␈↓ α_␈↓␈↓ β8may␈α
be␈α␈↓αt␈↓␈α
or␈α
omitted␈αto␈α
signify␈αthe␈α
terminal)␈α
to␈α␈↓↓x␈↓,␈α
which␈α
may␈αbe␈α
␈↓αnil␈↓␈αor␈α
␈↓αt␈↓.
␈↓ α_␈↓␈↓ β8␈↓↓x␈↓ and ␈↓↓f␈↓ are evaluated.
␈↓ α_␈↓␈↓αlinmode␈↓␈↓ β8␈↓α(status␈αlinmode␈↓)␈αreads␈αthe␈α"line␈αmode,"␈αand␈α␈↓α(sstatus␈αlinmode␈↓␈α␈↓↓x␈↓)␈αsets
␈↓ α_␈↓␈↓ β8the␈α
"line␈α∞mode"␈α
to␈α
␈↓↓x␈↓␈α∞(␈↓αt␈↓␈α
or␈α∞␈↓αnil␈↓.)␈α
These␈α
functions␈α∞take␈α
an␈α∞optional␈α
extra
␈↓ α_␈↓␈↓ β8argument,␈α⊂which␈α⊂is␈α⊂the␈α⊂≡le␈α⊂whose␈α⊂line␈α⊂mode␈α⊂is␈α⊂being␈α⊂discussed.␈α∂ This
␈↓ α_␈↓␈↓ β8defaults␈α
to␈α␈↓αt␈↓,␈α
the␈αterminal.␈α
In␈α
any␈αcase,␈α
this␈α≡le␈α
must␈αbe␈α
a␈α
terminal.␈α In
␈↓ α_␈↓␈↓ β8some␈α
implementations␈αthe␈α
"line␈α
mode"␈αmay␈α
not␈α
be␈αchanged.␈α
If␈α
the␈α"line
␈↓ α_␈↓␈↓ β8mode"␈αis␈α
␈↓αt␈↓,␈αuser␈αinput␈α
is␈αbu≥ered␈αup␈α
a␈αline␈α
at␈αa␈αtime␈α
before␈αbeing␈αsent␈α
to
␈↓ α_␈↓␈↓ β8LISP.␈α∂ The␈α∂input-editing␈α∂conventions␈α∂of␈α∂the␈α∂host␈α∂operating␈α∂system␈α∂are
␈↓ α_␈↓␈↓ β8used.␈α
If␈α
the␈α
"line␈α
mode"␈α
is␈α∞␈↓αnil␈↓,␈α
LISP␈α
sees␈α
each␈α
character␈α
as␈α
it␈α∞is␈α
typed
␈↓ α_␈↓␈↓ β8and␈α∞applies␈α∞its␈α∞own␈α∞input␈α
editing␈α∞conventions.␈α∞ This␈α∞mode␈α∞can␈α
provide
␈↓ α_␈↓␈↓ β8input␈α
facilities␈α
more␈α
suited␈α
to␈α
LISP␈α
and␈α
possibly␈α
better␈α
handling␈α
of␈αthe
␈↓ α_␈↓␈↓ β8terminal,␈αif␈αit␈αis␈αa␈αtype␈αthat␈αLISP␈αknows␈αa␈αgreat␈αdeal␈αabout.␈α However,␈αit
␈↓ α_␈↓␈↓ β8uses␈α∞more␈α∞machine␈α∞resources.␈α∞ It␈α∞is␈α∞possible␈α∞for␈α∞a␈α∞user␈α∞program␈α∞to␈α
take
␈↓ α_␈↓␈↓ β8direct␈αcontrol␈α
of␈αthe␈αterminal␈α
when␈αthe␈α"line␈α
mode"␈αis␈α␈↓αnil␈↓,␈α
however␈αthis
␈↓ α_␈↓␈↓ β8may␈α⊂require␈α⊃knowledge␈α⊂of␈α⊂the␈α⊃undocumented␈α⊂(␈↓αsstatus␈α⊃tty␈↓)␈α⊂function.
␈↓ α_␈↓␈↓ β8The␈α
Multics␈α
implementation␈α
always␈α
operates␈α
with␈α
a␈α
"line␈α
mode"␈α
of␈α
␈↓αt␈↓.␈α
See
␈↓ α_␈↓␈↓ β8also the ␈↓α(sstatus ttyscan)␈↓ function below.
␈↓ α_␈↓␈↓αttyint␈↓␈↓ β8␈↓α(sstatus␈α∪ttyint␈α∪␈↓↓char␈α∪func␈α∪≡le␈↓α)␈↓␈α∪turns␈α∪on␈α∪a␈α∪tty␈α∪interrupt␈α∪character.
␈↓ α_␈↓␈↓ β8When␈αthe␈αcharacter␈α␈↓↓char␈↓␈αis␈αtyped␈αon␈αthe␈αinput␈αtty␈α␈↓↓≡le␈↓,␈αthe␈αLISP␈αprogram
␈↓ α_␈↓␈↓ β8will␈α⊗be␈α⊗interrupted␈α⊗and␈α⊗the␈α⊗function␈α⊗␈↓↓func␈↓␈α⊗will␈α⊗be␈α⊗applied␈α↔to␈α⊗two
␈↓ α_␈↓␈↓ β8arguments␈α
-␈α
␈↓↓≡le␈↓␈α
and␈α
␈↓↓char␈↓.␈α
If␈α
␈↓↓≡le␈↓␈αis␈α
omitted,␈α
␈↓αt␈↓,␈α
the␈α
ordinary␈α
tty␈α
input,␈αis
␈↓ α_␈↓␈↓ β8assumed.␈α∞ The␈α∞␈↓↓char␈↓␈α
may␈α∞be␈α∞either␈α
a␈α∞character␈α∞object␈α
or␈α∞a␈α∞≡xnum␈α
(ascii
␈↓ α_␈↓␈↓ β8code).␈α∞ Any␈α
of␈α∞the␈α
128.␈α∞ascii␈α
characters␈α∞may␈α
be␈α∞used.␈α
The␈α∞␈↓↓func␈↓␈α∞may␈α
be
␈↓ α_␈↓␈↓ β8either␈αan␈αordinary␈α
functional␈αform␈αor␈αa␈α
≡xnum,␈αwhich␈αmeans␈αthe␈α
default
␈↓ α_␈↓␈↓ β8system␈α∂action␈α⊂for␈α∂that␈α⊂character.␈α∂ For␈α∂instance␈α⊂a␈α∂␈↓↓func␈↓␈α⊂of␈α∂7␈α⊂means␈α∂quit
␈↓ α_␈↓␈↓ β8back␈αto␈αthe␈αtop␈αlevel␈αof␈αlisp␈α(control-G).␈α If␈α␈↓↓func␈↓␈αis␈α␈↓αnil␈↓,␈αthe␈α␈↓↓char␈↓␈αis␈αmade
␈↓ α_␈↓␈↓ β8non-interrupting. All three arguments are evaluated.
␈↓ α_␈↓␈↓ β8␈↓α(status␈α∂ttyint␈α∂␈↓↓char␈α∂≡le␈↓α)␈↓␈α∂returns␈α∂␈↓↓func␈↓,␈α∂the␈α∂interrupt␈α∂function␈α∂for␈α∞the
␈↓ α_␈↓␈↓ β8character ␈↓↓char␈↓ on the tty ␈↓↓≡le␈↓. ␈↓↓≡le␈↓ may be omitted. It defaults to ␈↓αt␈↓.
␈↓ α_␈↓␈↓αttycons␈↓␈↓ β8␈↓α(sstatus␈α⊃ttycons␈α⊃␈↓↓tty1␈α⊃tty2␈↓α)␈↓␈α⊃binds␈α⊂two␈α⊃tty␈α⊃≡les␈α⊃into␈α⊃a␈α⊃console.␈α⊂ One
␈↓ α_␈↓␈↓ β8should␈αbe␈αan␈αinput␈αtty␈αand␈αthe␈αother␈α
an␈αoutput␈αtty.␈α If␈α␈↓↓tty1␈↓␈αor␈α␈↓↓tty2␈↓␈αis␈α␈↓αt␈↓,␈α
it
␈↓ α_␈↓␈↓ β8will␈α
be␈α
taken␈α∞as␈α
the␈α
appropriate␈α
direction␈α∞of␈α
the␈α
regular␈α∞terminal.␈α
The
␈↓ α_␈↓␈↓ β8binding␈α⊃into␈α⊃a␈α∩console␈α⊃is␈α⊃basically␈α⊃used␈α∩for␈α⊃purposes␈α⊃of␈α∩echoing.␈α⊃ In
␈↓ α_␈↓␈↓ β8addition,␈αinterrupt␈α
characters␈αtyped␈α
on␈αan␈α
input␈αtty␈α
≡le␈αshould␈α
a≥ect␈αthe
␈↓ α_␈↓␈↓ β8output on its corresponding output tty ≡le, not on some other tty.
␈↓ α_␈↓␈↓ β8To put echoing at the bottom of the screen, distinct from output,
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ ␈Page 3-61
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓α␈↓ ∧λ(sstatus ttycons t
␈↓ α_␈↓α␈↓ ∧λ (open 'tty: '(echo out tty)))
␈↓ α_␈↓␈↓ β8which␈α
conses␈α
tty␈α
input␈αwith␈α
a␈α
new␈α
tty␈α
output␈αchannel␈α
which␈α
is␈α
set␈α
to␈αgo␈α
to
␈↓ α_␈↓␈↓ β8the echo area at the bottom of the screen.
␈↓ α_␈↓␈↓ β8␈↓α(status␈α∞ttycons␈α
␈↓↓tty1␈↓α)␈↓␈α∞returns␈α
the␈α∞other␈α
tty␈α∞≡le␈α
which␈α∞is␈α
bound␈α∞into␈α
a
␈↓ α_␈↓␈↓ β8console with ␈↓↓tty1␈↓, or ␈↓αnil␈↓ if there is none.
␈↓ α_␈↓␈↓α≡lemode␈↓␈↓ β8␈↓α(status␈α⊗≡lemode␈α↔␈↓↓≡le␈↓α)␈α⊗=>␈α⊗(open-mode-list␈α↔.␈α⊗internal-cruft)␈↓.
␈↓ α_␈↓␈↓ β8␈↓↓open-mode-list␈↓␈α∀is␈α∃a␈α∀suitable␈α∀second␈α∃argument␈α∀for␈α∀the␈α∃␈↓αopen␈↓␈α∀function.
␈↓ α_␈↓␈↓ β8␈↓↓internal-cruft␈↓␈α⊂is␈α⊂a␈α⊂list␈α⊂of␈α⊂implementation-dependent␈α⊃information␈α⊂which
␈↓ α_␈↓␈↓ β8may sometimes be needed by special programs.
␈↓ α_␈↓␈↓ β8The␈α∩following␈α∩symbols␈α∩may␈α∩appear␈α∩in␈α∩␈↓↓internal-cruft␈↓.␈α∩ (These␈α∩are␈α⊃the
␈↓ α_␈↓␈↓ β8standardized␈α
ones;␈αadditional␈α
symbols␈αmay␈α
appear␈α
at␈αthe␈α
discretion␈αof␈α
the
␈↓ α_␈↓␈↓ β8implementation.)
␈↓ α_␈↓␈↓ β8␈↓αcursorpos␈↓␈↓ ¬(This␈α∞≡le␈α
(an␈α∞output␈α∞tty)␈α
has␈α∞the␈α
ability␈α∞to␈α∞position␈α
its
␈↓ α_␈↓␈↓ ¬(cursor anywhere on the screen.
␈↓ α_␈↓␈↓ β8␈↓αrubout␈↓␈↓ ¬(This␈α∞≡le␈α∞(an␈α∞output␈α∞tty)␈α∞has␈α∞selective␈α∞erase␈α∞capability.
␈↓ α_␈↓␈↓ ¬(␈↓α(cursorpos 'x)␈↓ will work.
␈↓ α_␈↓␈↓ β8␈↓αsail␈↓␈↓ ¬(This␈α_≡le␈α_(an␈α_output␈α_tty)␈α_has␈α_the␈α→so-called␈α_SAIL
␈↓ α_␈↓␈↓ ¬(character␈α∂set.␈α∂ This␈α∂is␈α⊂an␈α∂extension␈α∂of␈α∂ascii␈α⊂which␈α∂is
␈↓ α_␈↓␈↓ ¬(related but not ␈↓αeq␈↓ to the SAIL character set.
␈↓ α_␈↓␈↓αttyscan␈↓␈↓ β8␈↓α(sstatus␈αttyscan␈α␈↓↓func␈α≡le␈↓α)␈↓␈αallows␈αthe␈αuser␈αto␈αsupply␈αa␈αfunction␈αwhich
␈↓ α_␈↓␈↓ β8performs␈αinitial␈αprocessing␈αof␈αterminal␈αinput.␈α ␈↓↓func␈↓␈αis␈αa␈αfunctional␈αform,
␈↓ α_␈↓␈↓ β8and␈α∂␈↓↓≡le␈↓␈α∂must␈α∂be␈α∂a␈α∂tty␈α∂input␈α⊂≡le.␈α∂ If␈α∂it␈α∂is␈α∂omitted,␈α∂␈↓αt␈↓␈α∂is␈α⊂assumed.␈α∂ Both
␈↓ α_␈↓␈↓ β8arguments are evaluated.
␈↓ α_␈↓␈↓ β8When␈α∪LISP␈α∪wants␈α∀to␈α∪take␈α∪input␈α∪from␈α∀␈↓↓≡le␈↓,␈α∪it␈α∪≡rst␈α∪calls␈α∀the␈α∪prescan
␈↓ α_␈↓␈↓ β8function,␈α
which␈αis␈α
supposed␈αto␈α
gobble␈α
down␈αa␈α
complete␈αunit␈α
of␈αinput␈α
(for
␈↓ α_␈↓␈↓ β8instance␈αan␈αS-expression)␈α
and␈αreturn␈αa␈α
list␈αof␈αcharacters.␈α The␈α
prescanner
␈↓ α_␈↓␈↓ β8supplied␈α∩automatically␈α∩by␈α∩LISP␈α∩when␈α∪a␈α∩tty␈α∩input␈α∩≡le␈α∩is␈α∪≡rst␈α∩opened
␈↓ α_␈↓␈↓ β8counts␈α~parentheses␈α≠and␈α~does␈α~fancy␈α≠rubout␈α~processing␈α≠on␈α~display
␈↓ α_␈↓␈↓ β8terminals.␈α∪ It␈α∩also␈α∪implements␈α∩the␈α∪control-K,␈α∩control-L,␈α∪and␈α∩control-U
␈↓ α_␈↓␈↓ β8characters␈αwhich␈αallow␈αthe␈αcomplete␈αinput␈αto␈αbe␈αredisplayed␈αor␈αcancelled,
␈↓ α_␈↓␈↓ β8and␈αtakes␈αcare␈αof␈αforce-feed␈αcharacters.␈α A␈αuser-written␈αprescanner␈αmight
␈↓ α_␈↓Page 3-62␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ β8provide␈α
additional␈α∞features␈α
such␈α∞as␈α
super-parentheses,␈α∞name␈α
recognition
␈↓ α_␈↓␈↓ β8and completion, or fancy editing.
␈↓ α_␈↓␈↓ β8The␈α⊂prescan␈α⊂function␈α⊂␈↓↓func␈↓␈α⊂is␈α⊂applied␈α⊂to␈α⊂three␈α⊂arguments:␈α⊂the␈α⊂␈↓↓≡le␈↓,␈α⊂the
␈↓ α_␈↓␈↓ β8name␈α
of␈α
the␈α
input␈α
function␈α
on␈αwhose␈α
behalf␈α
it␈α
is␈α
acting␈α
(␈↓αread␈↓,␈α␈↓αreadch␈↓,
␈↓ α_␈↓␈↓ β8or␈α
␈↓αreadline␈↓),␈α
and␈αa␈α
≡xnum␈α
which,␈α
in␈αthe␈α
case␈α
of␈α␈↓αread␈↓,␈α
is␈α
the␈α
count␈αof
␈↓ α_␈↓␈↓ β8the␈αnumber␈αof␈α
unmatched␈αleft-parentheses.␈α It␈αis␈α
supposed␈αto␈αreturn␈αa␈α
list
␈↓ α_␈↓␈↓ β8of␈α⊃≡xnums,␈α⊃which␈α∩represent␈α⊃characters.␈α⊃ The␈α⊃prescan␈α∩function␈α⊃should
␈↓ α_␈↓␈↓ β8read␈αthe␈αinput␈αwith␈α␈↓αtyi␈↓,␈αsince␈αit␈αand␈α␈↓αtyipeek␈↓␈αis␈αthe␈αonly␈αinput␈αfunction
␈↓ α_␈↓␈↓ β8which doesn't call the prescan.
␈↓ α_␈↓␈↓ β8If␈α⊃the␈α⊂pre-scan␈α⊃function␈α⊃returns␈α⊂␈↓αnil␈↓,␈α⊃an␈α⊃eof␈α⊂condition␈α⊃occurs␈α⊃for␈α⊂the
␈↓ α_␈↓␈↓ β8input ≡le. This is the standard way to signal over-rubout.
␈↓ α_␈↓␈↓ β8There␈αis␈αa␈αfunction␈αcalled␈α␈↓αrubout␈↓␈αto␈αassist␈αthe␈αpre-scanner␈αin␈αprocessing
␈↓ α_␈↓␈↓ β8rubouts. It is described on page .
␈↓ α_␈↓␈↓ β8It␈αis␈αa␈αgood␈αidea␈αfor␈αthe␈αprescan␈αfunction␈αto␈α␈↓αlambda␈↓-bind␈α␈↓αecho≡les␈↓␈αto
␈↓ α_␈↓␈↓ β8␈↓αnil␈↓␈α
so␈αthat␈α
characters␈αdo␈α
not␈α
appear␈αin␈α
the␈αecho␈α
≡les␈αtwice,␈α
and␈α
so␈αthat
␈↓ α_␈↓␈↓ β8the echo ≡les re∨ect the "clean" input after rubout processing.
␈↓ α_␈↓␈↓ β8␈↓α(status ttyscan ␈↓↓≡le␈↓α)␈↓ returns the ␈↓↓≡le␈↓'s ␈↓↓func␈↓.
␈↓ α_␈↓␈↓ β8This feature does not presently exist in the Multics implementation.
␈↓ α_␈↓␈↓βSTATUS FUNCTIONS FOR THE OLD I/O SYSTEM␈↓
␈↓ α_␈↓␈↓αuread␈↓␈↓ β8␈↓α(status␈α∞uread)␈↓␈α
returns␈α∞a␈α∞4-list␈α
for␈α∞the␈α∞current␈α
␈↓αuread␈↓␈α∞input␈α∞source,␈α
or
␈↓ α_␈↓␈↓ β8␈↓αnil␈↓ if ␈↓αuread␈↓ is not being done.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus uread --args--)␈↓ is the same as ␈↓α(uread --args--)␈↓
␈↓ α_␈↓␈↓αuwrite␈↓␈↓ β8␈↓α(status␈α∃uwrite)␈↓␈α∃returns␈α∃the␈α⊗2-list␈α∃for␈α∃the␈α∃current␈α⊗␈↓αuwrite␈↓␈α∃output
␈↓ α_␈↓␈↓ β8destination.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus uwrite --args--)␈↓ is the same as ␈↓α(uwrite --args--)␈↓
␈↓ α_␈↓␈↓αcrunit␈↓␈↓ β8␈↓α(status␈α⊂crunit)␈↓␈α⊂returns␈α⊂a␈α⊂2-list␈α⊂of␈α⊂the␈α⊂current␈α⊂unit;␈α⊂i.e.␈α⊂ device␈α⊂and
␈↓ α_␈↓␈↓ β8directory.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α⊂crunit␈α⊃device␈α⊂directory)␈↓␈α⊂sets␈α⊃the␈α⊂current␈α⊃default␈α⊂device
␈↓ α_␈↓␈↓ β8and directory for ␈↓αuread␈↓, etc. The arguments are not evaluated.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ {Page 3-63
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αcr≡le␈↓␈↓ β8␈↓α(status␈α∞cr≡le)␈↓␈α∞returns␈α∞a␈α∞2-list␈α∞giving␈α∞the␈α∞≡le␈α∞names␈α∞for␈α∂the␈α∞current
␈↓ α_␈↓␈↓ β8≡le in the "␈↓αuread␈↓" I/O system.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α∞cr≡le␈α
name1␈α∞name2)␈↓␈α
sets␈α∞the␈α
current␈α∞default␈α
≡le␈α∞names␈α
for
␈↓ α_␈↓␈↓ β8␈↓αuread␈↓, etc. The arguments are not evaluated.
␈↓ α_␈↓␈↓βSTATUS FUNCTIONS FOR THE READER␈↓
␈↓ α_␈↓␈↓ αHSee␈α⊃section␈α⊂13.6.2␈α⊃for␈α⊂a␈α⊃description␈α⊃of␈α⊂how␈α⊃the␈α⊂parameters␈α⊃controlled␈α⊃by␈α⊂these
␈↓ α_␈↓functions␈α∂are␈α⊂used.␈α∂ Note:␈α⊂in␈α∂the␈α∂following,␈α⊂␈↓↓c␈↓␈α∂represents␈α⊂an␈α∂argument␈α⊂specifying␈α∂a
␈↓ α_␈↓character.␈α
If␈α␈↓↓c␈↓␈α
is␈α
non-atomic␈αit␈α
is␈αevaluated,␈α
and␈α
the␈αvalue␈α
must␈α
be␈αa␈α
≡xnum␈αwhich␈α
is
␈↓ α_␈↓the␈α∂ascii␈α∂code␈α∞for␈α∂a␈α∂character.␈α∂ If␈α∞␈↓↓c␈↓␈α∂is␈α∂atomic␈α∞it␈α∂is␈α∂not␈α∂evaluated,␈α∞and␈α∂it␈α∂may␈α∂be␈α∞a
␈↓ α_␈↓≡xnum or a character object.
␈↓ α_␈↓␈↓αchtran␈↓␈↓ β8␈↓α(status␈α⊃chtran␈α∩␈↓↓c␈↓α)␈↓␈α⊃gets␈α∩the␈α⊃character␈α⊃translation␈α∩table␈α⊃entry␈α∩for␈α⊃the
␈↓ α_␈↓␈↓ β8character␈α
␈↓↓c␈↓.␈α
This␈α
is␈αthe␈α
ascii␈α
code␈α
of␈α
a␈αcharacter␈α
substituted␈α
for␈α
␈↓↓c␈↓␈αwhen␈α
it
␈↓ α_␈↓␈↓ β8appears␈α∞in␈α∞a␈α∞pname␈α∞being␈α∞read␈α∞in.␈α∞ This␈α∞feature␈α∞is␈α∞used␈α∞in␈α∞the␈α
pdp-10
␈↓ α_␈↓␈↓ β8implementations to translate lower-case input to upper case.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α∞chtran␈α∞␈↓↓c␈α∞k␈↓α)␈↓␈α∞sets␈α∞␈↓↓c␈↓'s␈α
character␈α∞translation␈α∞to␈α∞␈↓↓k␈↓.␈α∞ ␈↓↓k␈↓␈α∞follows␈α
the
␈↓ α_␈↓␈↓ β8same␈α
rules␈α∞as␈α
␈↓↓c␈↓,␈α∞i.e.␈α
it␈α∞may␈α
be␈α
a␈α∞list␈α
which␈α∞evaluates␈α
to␈α∞a␈α
≡xnum,␈α∞or␈α
an
␈↓ α_␈↓␈↓ β8unevaluated␈α⊂atom␈α∂such␈α⊂as␈α⊂a␈α∂≡xnum␈α⊂or␈α⊂a␈α∂character␈α⊂object.␈α⊂ The␈α∂value
␈↓ α_␈↓␈↓ β8returned is ␈↓↓k␈↓ as a ≡xnum ascii code.
␈↓ α_␈↓␈↓αsyntax␈↓␈↓ β8␈↓α(status␈α⊃syntax␈α∩␈↓↓c␈↓α)␈↓␈α⊃returns␈α∩the␈α⊃syntax␈α⊃bits␈α∩for␈α⊃the␈α∩character␈α⊃␈↓↓c␈↓,␈α∩as␈α⊃a
␈↓ α_␈↓␈↓ β8≡xnum.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α⊂syntax␈α⊂␈↓↓c␈α⊃m␈↓α)␈↓␈α⊂sets␈α⊂␈↓↓c␈↓'s␈α⊃syntax␈α⊂bits␈α⊂to␈α⊃␈↓↓m␈↓.␈α⊂ ␈↓↓m␈↓␈α⊂is␈α⊃evaluated␈α⊂and
␈↓ α_␈↓␈↓ β8returned.␈α∂ The␈α⊂␈↓αsetsyntax␈↓␈α∂function␈α⊂is␈α∂usually␈α⊂a␈α∂better␈α⊂way␈α∂to␈α⊂do␈α∂this,
␈↓ α_␈↓␈↓ β8however.
␈↓ α_␈↓␈↓ β8Note␈αthat␈α
in␈αthe␈α
above␈αtwo␈α␈↓αsstatus␈↓␈α
calls,␈αif␈α
␈↓↓c␈↓␈αis␈αa␈α
macro␈αcharacter␈α
it␈αis
␈↓ α_␈↓␈↓ β8changed␈α⊃back␈α⊃to␈α⊃its␈α⊃standard␈α⊂syntax␈α⊃and␈α⊃chtran␈α⊃before␈α⊃the␈α⊂requested
␈↓ α_␈↓␈↓ β8operation␈α⊂is␈α⊂performed.␈α⊂ However,␈α⊂if␈α⊃in␈α⊂the␈α⊂standard␈α⊂readtable␈α⊂␈↓↓c␈↓␈α⊃is␈α⊂a
␈↓ α_␈↓␈↓ β8macro␈α(i.e.␈α␈↓α'␈↓␈αand␈α␈↓α;␈↓),␈αinstead␈αof␈αbeing␈αchanged␈αto␈αits␈αstandard␈αsyntax␈αand
␈↓ α_␈↓␈↓ β8chtran␈α⊃its␈α⊂syntax␈α⊃is␈α⊃set␈α⊂to␈α⊃502␈α⊃(slashi≡ed␈α⊂extended␈α⊃alphabetic)␈α⊃and␈α⊂its
␈↓ α_␈↓␈↓ β8chtran is set to itself.
␈↓ α_␈↓␈↓αmacro␈↓␈↓ β8␈↓α(status␈α∞macro␈α∞␈↓↓c␈↓α)␈↓␈α∞returns␈α∞␈↓αnil␈↓␈α∞if␈α∞␈↓↓c␈↓␈α∞is␈α∞not␈α∞a␈α∞macro␈α∞character.␈α∞ If␈α∞␈↓↓c␈↓␈α∂is␈α∞a
␈↓ α_␈↓␈↓ β8macro␈αcharacter␈αit␈αreturns␈αa␈αlist␈αof␈αthe␈αmacro␈αcharacter␈αfunction␈αand␈αthe
␈↓ α_␈↓␈↓ β8type, which is ␈↓αnil␈↓ for normal macros and ␈↓αs␈↓ for splicing macros.
␈↓ α_␈↓Page 3-64␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α⊗macro␈α⊗␈↓↓c␈α⊗f␈↓α)␈↓␈α⊗makes␈α∃␈↓↓c␈↓␈α⊗a␈α⊗macro␈α⊗character␈α⊗which␈α⊗calls␈α∃the
␈↓ α_␈↓␈↓ β8function␈α⊂␈↓↓f␈↓␈α⊂with␈α⊂no␈α⊂arguments.␈α⊂ ␈↓↓f␈↓␈α⊂is␈α⊂evaluated.␈α⊂ A␈α⊂fourth␈α⊂argument␈α∂to
␈↓ α_␈↓␈↓ β8␈↓αsstatus␈↓␈αmay␈αbe␈αsupplied.␈α It␈αis␈αnot␈αevaluated.␈α If␈αit␈αis␈αan␈αatomic␈αsymbol
␈↓ α_␈↓␈↓ β8whose␈α∂pname␈α⊂begins␈α∂with␈α⊂␈↓αs␈↓,␈α∂␈↓↓c␈↓␈α⊂is␈α∂made␈α∂a␈α⊂splicing␈α∂macro.␈α⊂ If␈α∂␈↓↓f␈↓␈α⊂is␈α∂␈↓αnil␈↓,
␈↓ α_␈↓␈↓ β8instead␈α
of␈α
␈↓↓c␈↓␈α∞being␈α
made␈α
a␈α
macro-character,␈α∞␈↓↓c␈↓'s␈α
macro␈α
abilities␈α∞are␈α
taken
␈↓ α_␈↓␈↓ β8away␈α∩and␈α⊃␈↓↓c␈↓␈α∩becomes␈α⊃an␈α∩ordinary␈α⊃extended-alphabetic␈α∩character.␈α⊃ The
␈↓ α_␈↓␈↓ β8␈↓αsetsyntax␈↓ function is generally a better way to do this, however.
␈↓ α_␈↓␈↓α+␈↓␈↓ β8␈↓α(status␈α∂+)␈↓␈α∂gets␈α∂the␈α∞value␈α∂of␈α∂the␈α∂␈↓α+␈↓␈α∂switch␈α∞(␈↓αt␈↓␈α∂or␈α∂␈↓αnil␈↓).␈α∂ This␈α∂switch␈α∞is
␈↓ α_␈↓␈↓ β8normally␈α∞␈↓αnil␈↓.␈α∂ If␈α∞it␈α∂is␈α∞␈↓αt␈↓,␈α∞atomic␈α∂symbols␈α∞more␈α∂than␈α∞one␈α∂character␈α∞long
␈↓ α_␈↓␈↓ β8beginning␈αwith␈αa␈α␈↓α+␈↓␈αor␈αa␈α␈↓α-␈↓␈α
are␈αinterpreted␈αas␈αnumbers␈αby␈αthe␈αreader␈α
even
␈↓ α_␈↓␈↓ β8if␈α∞they␈α∞contain␈α∞letters.␈α∞ This␈α∞allows␈α
the␈α∞use␈α∞of␈α∞input␈α∞bases␈α∞greater␈α
than
␈↓ α_␈↓␈↓ β8ten.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α∞+␈α
␈↓↓x␈↓α)␈↓␈α∞sets␈α
the␈α∞␈↓α+␈↓␈α
switch␈α∞to␈α
␈↓αt␈↓␈α∞or␈α
␈↓αnil␈↓␈α∞depending␈α
on␈α∞␈↓↓x␈↓,␈α∞which␈α
is
␈↓ α_␈↓␈↓ β8evaluated. The new value of the ␈↓α+␈↓ switch is returned.
␈↓ α_␈↓␈↓αttyread␈↓␈↓ β8␈↓α(status␈αttyread␈↓↓␈α≡le␈↓α)␈↓␈αreturns␈α
the␈αvalue␈αof␈αthe␈α
ttyread␈αswitch␈αfor␈αthe␈α
≡le
␈↓ α_␈↓␈↓ β8␈↓↓≡le␈↓.␈α⊃ If␈α∩␈↓↓≡le␈↓␈α⊃is␈α⊃omitted␈α∩␈↓αt␈↓␈α⊃is␈α⊃assumed.␈α∩ At␈α⊃present␈α⊃this␈α∩is␈α⊃not␈α∩used␈α⊃for
␈↓ α_␈↓␈↓ β8anything␈αin␈αthe␈αMultics␈αimplementation.␈α In␈αthe␈αpdp-10␈αimplementation␈αit
␈↓ α_␈↓␈↓ β8controls␈α∂whether␈α∞tty␈α∂"force␈α∂feed"␈α∞characters␈α∂are␈α∞used.␈α∂ See␈α∂section␈α∞13.6.2
␈↓ α_␈↓␈↓ β8for details of force feed characters.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α⊂ttyread␈α⊂␈↓↓x␈α⊂≡le␈↓α)␈↓␈α⊂sets␈α⊂the␈α⊂ttyread␈α⊂switch␈α⊂for␈α⊂␈↓↓≡le␈↓␈α⊂to␈α⊂␈↓αt␈↓␈α⊃or␈α⊂␈↓αnil␈↓
␈↓ α_␈↓␈↓ β8depending␈αon␈α
␈↓↓x␈↓,␈αwhich␈αis␈α
evaluated.␈α Again,␈α␈↓↓≡le␈↓␈α
defaults␈αto␈α␈↓αt␈↓.␈α
The␈αnew
␈↓ α_␈↓␈↓ β8value of the switch is returned.
␈↓ α_␈↓␈↓βSTATUS FUNCTIONS FOR THE PRINTER␈↓
␈↓ α_␈↓␈↓αterpri␈↓␈↓ β8␈↓α(status␈α∞terpri␈α∞␈↓↓≡le␈↓α)␈↓␈α∞returns␈α∞the␈α∂value␈α∞(␈↓αt␈↓␈α∞or␈α∞␈↓αnil␈↓)␈α∞of␈α∞the␈α∂terpri␈α∞switch
␈↓ α_␈↓␈↓ β8for␈αthe␈α␈↓↓≡le␈↓,␈αwhich␈αdefaults␈αto␈α␈↓αt␈↓.␈α This␈αswitch␈αis␈αnormally␈α␈↓αnil␈↓.␈α If␈αit␈αis␈α␈↓αt␈↓,
␈↓ α_␈↓␈↓ β8the␈α∞output␈α∂functions␈α∞such␈α∞as␈α∂␈↓αprint␈↓␈α∞and␈α∞␈↓αtyo␈↓␈α∂will␈α∞not␈α∞output␈α∂any␈α∞extra
␈↓ α_␈↓␈↓ β8newlines when lines longer than ␈↓αlinel␈↓ are typed out.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus terpri ␈↓↓x ≡le␈↓α)␈↓ sets the terpri switch.
␈↓ α_␈↓␈↓α←␈↓␈↓ β8␈↓α(status␈α←␈α␈↓↓≡le␈↓α)␈↓␈α
returns␈αthe␈αvalue␈α(␈↓αt␈↓␈α
or␈α␈↓αnil␈↓)␈αof␈αthe␈α
␈↓α←␈↓␈αswitch␈αfor␈α
the␈α␈↓↓≡le␈↓,
␈↓ α_␈↓␈↓ β8which␈α
defaults␈α∞to␈α
␈↓αt␈↓.␈α
If␈α∞this␈α
switch␈α
is␈α∞␈↓αt␈↓,␈α
the␈α
␈↓α←␈↓␈α∞format␈α
for␈α∞≡xnums␈α
with
␈↓ α_␈↓␈↓ β8lots of trailing zeroes is not used.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus ← ␈↓↓x ≡le␈↓α)␈↓ sets the ␈↓α←␈↓ switch to the value of ␈↓↓x␈↓, ␈↓αt␈↓ or ␈↓αnil␈↓.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ {Page 3-65
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αabbreviate␈↓␈↓ β8␈↓α(status␈α∩abbreviate)␈↓␈α∩returns␈α∩the␈α∩value␈α∩of␈α∩the␈α∩abbreviation␈α∩control.
␈↓ α_␈↓␈↓ β8See section 13.7 for a description of the abbreviation control.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus abbreviate ␈↓↓n␈↓α)␈↓ sets the abbreviation control to ␈↓↓n␈↓.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus abbreviate nil)␈↓ turns o≥ abbreviation.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus abbreviate t)␈↓ turns on a maximal amount of abbreviation.
␈↓ α_␈↓␈↓βSTATUS FUNCTION FOR THE GARBAGE COLLECTOR␈↓
␈↓ α_␈↓␈↓αgctime␈↓␈↓ β8␈↓α(status␈α⊂gctime)␈↓␈α⊂returns␈α⊂the␈α⊂number␈α⊂of␈α⊂microseconds␈α⊂spent␈α⊂garbage-
␈↓ α_␈↓␈↓ β8collecting.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α∩gctime␈α∩␈↓↓n␈↓α)␈↓␈α⊃resets␈α∩the␈α∩gctime␈α∩counter␈α⊃to␈α∩␈↓↓n␈↓␈α∩and␈α∩returns␈α⊃the
␈↓ α_␈↓␈↓ β8␈↓↓previous␈↓ value of the gctime counter.
␈↓ α_␈↓␈↓α(status␈α∞spcnames)␈↓␈α∂ returns␈α∞a␈α∂list␈α∞of␈α∂the␈α∞names␈α∞of␈α∂all␈α∞the␈α∂spaces␈α∞available␈α∂in␈α∞the
␈↓ α_␈↓␈↓ β8LISP being used. These are the names acceptable to the ␈↓αalloc␈↓ function.
␈↓ α_␈↓␈↓α(status␈αspcsize␈α␈↓↓space␈↓α)␈↓␈α returns␈αthe␈αactual,␈αcurrent␈αsize␈αof␈α␈↓↓space␈↓,␈αin␈αwords.␈α ␈↓↓space␈↓␈αis
␈↓ α_␈↓␈↓ β8evaluated.
␈↓ α_␈↓␈↓α(status pdlsize ␈↓↓space␈↓α)␈↓ returns the current number of words on a pdl.
␈↓ α_␈↓␈↓α(status␈α∞pdlroom␈α∞␈↓↓space␈↓α)␈↓␈α∞ returns␈α
the␈α∞"pdlroom"␈α∞of␈α∞a␈α
pdl,␈α∞i.e.␈α∞the␈α∞maximum␈α∞size␈α
to
␈↓ α_␈↓␈↓ β8which it may ever grow.
␈↓ α_␈↓␈↓α(status␈α∞pdlmax␈α∂␈↓↓space)␈↓␈α∞ returns␈α∞the␈α∂current␈α∞value␈α∞of␈α∂the␈α∞"pdlmax"␈α∞parameter␈α∂of␈α∞a
␈↓ α_␈↓␈↓ β8pdl.
␈↓ α_␈↓␈↓α(sstatus␈α∞pdlmax␈α∞␈↓↓space␈α∞size␈↓α)␈↓␈α∞ sets␈α∞the␈α∂pdlmax␈α∞parameter␈α∞for␈α∞the␈α∞pdl␈α∞␈↓↓space␈↓␈α∂to␈α∞␈↓↓size␈↓.
␈↓ α_␈↓␈↓ β8Both arguments are evaluated.
␈↓ α_␈↓␈↓βENVIRONMENT ENQUIRIES␈↓
␈↓ α_␈↓␈↓αdate␈↓␈↓ β8␈↓α(status␈α⊂date)␈↓␈α⊃returns␈α⊂a␈α⊃3-list␈α⊂indicating␈α⊂the␈α⊃current␈α⊂date␈α⊃as␈α⊂␈↓α(last-
␈↓ α_␈↓α␈↓ β8two-digits-of-the-year month-number day)␈↓.
␈↓ α_␈↓␈↓αdow␈↓␈↓ β8␈↓α(status␈αdow␈↓)␈αreturns␈α
an␈αatomic␈αsymbol␈α
which␈αis␈αthe␈α
name␈αof␈αthe␈α
current
␈↓ α_␈↓␈↓ β8day of the week.
␈↓ α_␈↓Page 3-66␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αdaytime␈↓␈↓ β8␈↓α(status␈αdaytime)␈↓␈α
returns␈αa␈α
3-list␈αof␈αthe␈α
24-hour␈αtime␈α
of␈αday␈α
as␈α␈↓α(hour
␈↓ α_␈↓α␈↓ β8minute second)␈↓.
␈↓ α_␈↓␈↓αtime␈↓␈↓ β8␈↓α(status␈αtime)␈↓␈αis␈αthe␈αsame␈αas␈α␈↓α(time)␈↓,␈αthe␈αnumber␈αof␈αseconds␈αthe␈α
system
␈↓ α_␈↓␈↓ β8has been up.
␈↓ α_␈↓␈↓αruntime␈↓␈↓ β8␈↓α(status␈α≤runtime)␈↓␈α≤is␈α≤the␈α≤same␈α≤as␈α≤␈↓α(runtime)␈↓,␈α≤the␈α≥number␈α≤of
␈↓ α_␈↓␈↓ β8microseconds of cpu time that have been used.
␈↓ α_␈↓␈↓αsystem␈↓␈↓ β8␈↓α(status␈αsystem␈α
␈↓↓x␈↓α)␈↓␈αreturns␈αa␈α
list␈αof␈αthe␈α
system␈αproperties␈αof␈α
the␈αatomic
␈↓ α_␈↓␈↓ β8symbol␈α∪␈↓↓x␈↓,␈α∪which␈α∪is␈α∪evaluated.␈α∪ This␈α∪list␈α∪may␈α∪contain␈α∀␈↓αsubr,␈α∪fsubr,
␈↓ α_␈↓α␈↓ β8macro,␈α⊂␈↓or␈↓α␈α⊂lsubr␈↓␈α⊂if␈α⊂␈↓↓x␈↓␈α⊂is␈α∂a␈α⊂system␈α⊂function,␈α⊂and␈α⊂␈↓αvalue␈↓␈α⊂if␈α⊂this␈α∂atomic
␈↓ α_␈↓␈↓ β8symbol is a system variable.
␈↓ α_␈↓␈↓αuname␈↓␈↓ β8␈↓α(status␈α⊂uname)␈↓␈α⊂returns␈α⊂an␈α⊃atomic␈α⊂symbol␈α⊂whose␈α⊂pname␈α⊂is␈α⊃the␈α⊂user's
␈↓ α_␈↓␈↓ β8login␈α↔name.␈α↔ In␈α⊗the␈α↔Multics␈α↔implementation␈α⊗this␈α↔is␈α↔in␈α↔the␈α⊗format
␈↓ α_␈↓␈↓ β8User.Project;␈α
the␈αdot␈α
will␈α
be␈αslashi≡ed␈α
if␈α␈↓αprint␈↓␈α
is␈α
used␈αto␈α
display␈αthis.␈α
In
␈↓ α_␈↓␈↓ β8the␈α⊃DEC-10␈α⊃implementation␈α⊂this␈α⊃is␈α⊃actually␈α⊂a␈α⊃list␈α⊃␈↓α(proj␈α⊃prog)␈↓␈α⊂rather
␈↓ α_␈↓␈↓ β8than a symbol.
␈↓ α_␈↓␈↓αudir␈↓␈↓ β8␈↓α(status␈α⊃udir)␈↓␈α⊂returns␈α⊃the␈α⊂name␈α⊃of␈α⊂the␈α⊃user's␈α⊂directory.␈α⊃ In␈α⊃the␈α⊂ITS
␈↓ α_␈↓␈↓ β8implementation␈α⊂this␈α⊃is␈α⊂the␈α⊃user's␈α⊂"master␈α⊂sname,"␈α⊃which␈α⊂is␈α⊃usually␈α⊂the
␈↓ α_␈↓␈↓ β8same␈αas␈αthe␈αuser's␈αname␈αas␈αreturned␈αby␈α␈↓α(status␈αuname)␈↓.␈α In␈αthe␈αMultics
␈↓ α_␈↓␈↓ β8implementation␈αthis␈αis␈αthe␈αuser's␈αdefault␈αworking␈αdirectory.␈α In␈αthe␈αDEC-
␈↓ α_␈↓␈↓ β810 implementation this is a list ␈↓α(proj prog)␈↓.
␈↓ α_␈↓␈↓αlispversion␈↓
␈↓ α_␈↓␈↓ β8␈↓α(status␈α∞lispversion)␈↓␈α∞returns␈α∂the␈α∞version␈α∞identi≡cation␈α∞of␈α∂lisp.␈α∞ This
␈↓ α_␈↓␈↓ β8is usually an atomic symbol.
␈↓ α_␈↓␈↓αjcl␈↓␈↓ β8␈↓α(status␈α∂jcl)␈↓␈α∂returns␈α∂the␈α∂"job␈α⊂command␈α∂line"␈α∂from␈α∂DDT␈α∂in␈α⊂the␈α∂ITS
␈↓ α_␈↓␈↓ β8implementation.␈α∩ Only␈α∩the␈α∪command␈α∩part␈α∩(after␈α∩altmode)␈α∪is␈α∩returned.
␈↓ α_␈↓␈↓ β8The␈α∩initialization␈α∩≡le␈α∩name␈α∩that␈α∩precedes␈α∩the␈α∩altmode␈α∩is␈α∪retained␈α∩by
␈↓ α_␈↓␈↓ β8LISP.␈α In␈αthe␈αMultics␈αimplementation␈αthis␈αreturns␈αthe␈α␈↓αexplodec␈↓'d␈αsecond
␈↓ α_␈↓␈↓ β8argument␈αof␈αthe␈αlisp␈α
command,␈αor␈αelse␈α␈↓αnil␈↓␈α
if␈αthe␈αlisp␈αcommand␈α
did␈αnot
␈↓ α_␈↓␈↓ β8have two arguments. If lisp was invoked by
␈↓ α_␈↓␈↓ ∧qlisp environment←name "foo bar"
␈↓ α_␈↓␈↓ β8then ␈↓α(status jcl) => (f o o / b a r)␈↓
␈↓ α_␈↓␈↓ β8This␈α
function␈α
is␈α
used␈α
by␈α
subsystem␈α
implemented␈α
in␈α
MACLISP␈α
to␈αpick␈α
up
␈↓ α_␈↓␈↓ β8the arguments from the command which invoked them.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ {Page 3-67
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ αHThe following status functions only exist in the Multics implementation.
␈↓ α_␈↓␈↓αpaging␈↓␈↓ β8␈↓α(status␈α⊃paging)␈↓␈α⊂returns␈α⊃a␈α⊃list␈α⊂of␈α⊃the␈α⊂paging-device␈α⊃page␈α⊃reads␈α⊂and
␈↓ α_␈↓␈↓ β8total page reads that have been caused by this process.
␈↓ α_␈↓␈↓αarg␈↓␈↓ β8␈↓α(status␈α⊃arg␈α⊃␈↓↓n␈↓α)␈↓␈α⊃returns␈α⊃the␈α⊃␈↓↓n␈↓+1'th␈α⊃argument␈α⊃of␈α⊃the␈α∩command␈α⊃which
␈↓ α_␈↓␈↓ β8invoked␈α_the␈α_subsystem,␈α_as␈α→an␈α_interned␈α_atomic␈α_symbol.␈α→ (The␈α_≡rst
␈↓ α_␈↓␈↓ β8argument,␈α∃␈↓α(status␈α∀arg␈α∃0)␈↓,␈α∀is␈α∃the␈α∀name␈α∃of␈α∀the␈α∃subsystem.)␈α∃␈↓αnil␈↓␈α∀is
␈↓ α_␈↓␈↓ β8returned if ␈↓↓n␈↓ is greater than the number of arguments to the command.
␈↓ α_␈↓␈↓βMISCELLANEOUS STATUS FUNCTIONS␈↓
␈↓ α_␈↓␈↓αevalhook␈↓␈↓ β8␈↓α(sstatus␈α~evalhook␈α~t)␈↓␈α≠enables␈α~the␈α~␈↓αevalhook␈↓␈α≠feature;␈α~␈↓α(sstatus
␈↓ α_␈↓α␈↓ β8evalhook␈αnil)␈↓␈αdisables␈αit.␈α ␈↓α(status␈αevalhook)␈↓␈αreturns␈αthe␈αstate␈α
of␈αthe
␈↓ α_␈↓␈↓ β8switch. See for the details of this feature.
␈↓ α_␈↓␈↓αtoplevel␈↓␈↓ β8␈↓α(status␈α∪toplevel)␈↓␈α∪returns␈α∀the␈α∪top-level␈α∪form,␈α∪which␈α∀is␈α∪continually
␈↓ α_␈↓␈↓ β8evaluated␈α∞when␈α∞LISP␈α
is␈α∞at␈α∞its␈α∞top␈α
level.␈α∞ If␈α∞this␈α
is␈α∞␈↓αnil␈↓,␈α∞a␈α∞normal␈α
read-
␈↓ α_␈↓␈↓ β8eval-print loop is used.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α∂toplevel␈α∂␈↓↓x␈↓α)␈↓␈α∂evaluates␈α∂and␈α⊂returns␈α∂␈↓↓x␈↓␈α∂and␈α∂sets␈α∂the␈α⊂top␈α∂level
␈↓ α_␈↓␈↓ β8form to this value.
␈↓ α_␈↓␈↓ β8For␈α
example,␈α∞to␈α
make␈α
MACLISP␈α∞have␈α
an␈α
␈↓↓evalquote␈↓␈α∞top␈α
level␈α∞similar␈α
to
␈↓ α_␈↓␈↓ β8LISP 1.5:
␈↓ α_␈↓α␈↓ ∧λ(sstatus toplevel
␈↓ α_␈↓α␈↓ ∧λ '(progn (print *)
␈↓ α_␈↓α␈↓ ∧λ (apply (read) (read)) ))
␈↓ α_␈↓␈↓ β8See section 12.1 for further details.
␈↓ α_␈↓␈↓αbreaklevel␈↓␈α≤␈↓α(status␈α≤breaklevel)␈↓␈α≤returns␈α≤the␈α≤break-loop␈α≤form.␈α≠ ␈↓α(sstatus
␈↓ α_␈↓α␈↓ β8breaklevel ␈↓↓x␈↓α)␈↓ sets this form. See for how this is used.
␈↓ α_␈↓␈↓αuuolinks␈↓␈↓ β8␈↓α(status␈α∞uuolinks)␈↓␈α∞returns␈α∞a␈α
number␈α∞which␈α∞represents␈α∞the␈α∞number␈α
of
␈↓ α_␈↓␈↓ β8available slots for linking between compiled functions.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α∞uuolinks)␈↓␈α∞causes␈α∞all␈α∞links␈α∞between␈α∞compiled␈α∞functions␈α∞to␈α
be
␈↓ α_␈↓␈↓ β8"unsnapped."␈α∩ This␈α∪should␈α∩be␈α∪done␈α∩whenever␈α∩␈↓α(nouuo␈α∪t)␈↓␈α∩is␈α∪done␈α∩to
␈↓ α_␈↓␈↓ β8insure␈α∀that␈α∀the␈α∀interpreter␈α∀always␈α∀gets␈α∀a␈α∀chance␈α∀to␈α∃save␈α∀debugging
␈↓ α_␈↓␈↓ β8information on every function call.
␈↓ α_␈↓Page 3-68␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αdivov␈↓␈↓ β8␈↓α(status␈α⊂divov)␈↓␈α⊂returns␈α⊂the␈α⊃state␈α⊂of␈α⊂the␈α⊂"divide␈α⊂over∨ow"␈α⊃switch.␈α⊂ If
␈↓ α_␈↓␈↓ β8this␈α∞switch␈α∞is␈α
␈↓αnil␈↓␈α∞an␈α∞attempt␈α∞to␈α
divide␈α∞by␈α∞zero␈α
causes␈α∞an␈α∞error.␈α∞ If␈α
the
␈↓ α_␈↓␈↓ β8switch is ␈↓αt␈↓ the result of a division by zero is the numerator plus 1.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus divov ␈↓↓x␈↓α)␈↓ sets the "divide over∨ow" switch to ␈↓↓x␈↓.
␈↓ α_␈↓␈↓ β8In␈α
the␈α
pdp-10␈α
implementation,␈α
␈↓αdivov␈↓␈α
applies␈α
only␈α
to␈α
␈↓αquotient␈↓.␈α
␈↓α//␈↓␈α
and
␈↓ α_␈↓␈↓ β8␈↓α//$␈↓ do not detect division by zero.
␈↓ α_␈↓␈↓αfeatures␈↓␈↓ β8␈↓α(status␈α∂features)␈↓␈α∞returns␈α∂a␈α∞list␈α∂of␈α∞symbols␈α∂representing␈α∂the␈α∞features
␈↓ α_␈↓␈↓ β8implemented␈α∃in␈α∃the␈α∃LISP␈α∀being␈α∃used.␈α∃ The␈α∃following␈α∃symbols␈α∀may
␈↓ α_␈↓␈↓ β8appear in this list:
␈↓ α_␈↓␈↓ ∧λbibop␈↓ ¬hpdp-10␈α≥big-bag-of-pages␈α≥memory␈α≥management
␈↓ α_␈↓␈↓ ¬xscheme
␈↓ α_␈↓␈↓ ∧λlap␈↓ ¬hthis LISP has a Lisp Assembly Program
␈↓ α_␈↓␈↓ ∧λsort␈↓ ¬hthe␈α∂sorting␈α∂functions␈α∂described␈α∂in␈α∂chapter␈α⊂11␈α∂are
␈↓ α_␈↓␈↓ ¬xpresent
␈↓ α_␈↓␈↓ ∧λedit␈↓ ¬hthe edit function described in chapter 18 is present
␈↓ α_␈↓␈↓ ∧λfasload␈↓ ¬hthe␈α∃fasload␈α∃facility␈α∃described␈α∃in␈α∃chapter␈α∃14␈α∀is
␈↓ α_␈↓␈↓ ¬xpresent
␈↓ α_␈↓␈↓ ∧λ↑f␈↓ ¬hthe "moby I/O" facility is present
␈↓ α_␈↓␈↓ ∧λbignum␈↓ ¬hthe␈α∨arbitrary-precision␈α≡arithmetic␈α∨package␈α≡is
␈↓ α_␈↓␈↓ ¬xincluded in this LISP
␈↓ α_␈↓␈↓ ∧λstrings␈↓ ¬hcharacter␈α→strings␈α→and␈α_the␈α→functions␈α→on␈α_them
␈↓ α_␈↓␈↓ ¬xdescribed in chapter 8 are present
␈↓ α_␈↓␈↓ ∧λnewio␈↓ ¬hthe␈α∃I/O␈α∀functions␈α∃described␈α∀in␈α∃chapter␈α∃13␈α∀are
␈↓ α_␈↓␈↓ ¬xincluded␈α∀in␈α∀this␈α∀LISP;␈α∀if␈α∀this␈α∀feature␈α∃is␈α∀not
␈↓ α_␈↓␈↓ ¬xpresent␈α≡only␈α≥some␈α≡of␈α≥those␈α≡functions␈α≥are
␈↓ α_␈↓␈↓ ¬xavailable.
␈↓ α_␈↓␈↓ ∧λtrace␈↓ ¬hthe trace package (chapter 15) is present.
␈↓ α_␈↓␈↓ ∧λgrindef␈↓ ¬hthe␈α∩function␈α⊃de≡nition␈α∩formatter␈α⊃(chapter␈α∩16)␈α⊃is
␈↓ α_␈↓␈↓ ¬xpresent.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ zPage 3-69
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ ∧λgrind␈↓ ¬hthe ≡le formatter (chapter 16) is present.
␈↓ α_␈↓␈↓ ∧λcompiler␈↓ ¬hthis␈αis␈αthe␈αLISP␈αcompiler␈α(chapter␈α14)␈αrather␈αthan
␈↓ α_␈↓␈↓ ¬xthe interpreter.
␈↓ α_␈↓␈↓ ∧λfastarith␈↓ ¬hthe␈α∩fast-arithmetic␈α∩features␈α∩of␈α∩the␈α∩compiler␈α⊃are
␈↓ α_␈↓␈↓ ¬xpresent
␈↓ α_␈↓␈↓ ∧λml␈↓ ¬hthis LISP is on the MathLab machine at MIT
␈↓ α_␈↓␈↓ ∧λai␈↓ ¬hthis LISP is on the AI machine at MIT
␈↓ α_␈↓␈↓ ∧λH6180␈↓ ¬hthis␈α∂LISP␈α∂is␈α∂on␈α∂an␈α∂H6180␈α∂Multics␈α∂machine␈α∂or␈α∞a
␈↓ α_␈↓␈↓ ¬xcompatible machine such as a 68/60 or a 68/80.
␈↓ α_␈↓␈↓ ∧λits␈↓ ¬hthis LISP is on some ITS system
␈↓ α_␈↓␈↓ ∧λMultics␈↓ ¬hthis LISP is on some Multics system
␈↓ α_␈↓␈↓ ∧λdec10␈↓ ¬hthis␈αLISP␈α
is␈αon␈α
some␈αDEC␈α
TOPS-10␈αsystem;␈αor␈α
on
␈↓ α_␈↓␈↓ ¬xsome␈α"TENEX␈α"system␈α"since␈α"the␈α!TENEX
␈↓ α_␈↓␈↓ ¬ximplementation runs under a TOPS-10 emulator.
␈↓ α_␈↓␈↓ β8A␈α∀package␈α∀being␈α∀"present"␈α∀means␈α∀that␈α∀it␈α∀has␈α∀been␈α∀loaded␈α∀into␈α∀the
␈↓ α_␈↓␈↓ β8environment.␈α If␈α␈↓α(status␈αfeatures)␈↓␈αclaims␈αit␈αis␈αnot␈αpresent,␈αit␈αmay␈αstill
␈↓ α_␈↓␈↓ β8be␈αavailable␈α
because␈αit␈α
may␈αbe␈α
automatically␈αloaded␈α
when␈αrequired.␈α
This
␈↓ α_␈↓␈↓ β8does not apply to the compiler.
␈↓ α_␈↓␈↓ β8␈↓α(car␈α
(last␈α
(status␈α
features)))␈↓␈α
is␈α
an␈α
implementation␈α
name,␈α∞such␈α
as
␈↓ α_␈↓␈↓ β8its␈αor␈αdec10␈α
or␈αMultics.␈α The␈α
main␈αidea␈αbehind␈αthis␈α
status␈αcall␈αis␈α
that␈αan
␈↓ α_␈↓␈↓ β8application␈α∂package␈α∂can␈α∂be␈α∞loaded␈α∂into␈α∂any␈α∂MACLISP␈α∞implementation
␈↓ α_␈↓␈↓ β8and can decide what to do on the basis of the features it ≡nds available.
␈↓ α_␈↓␈↓αfeature␈↓␈↓ β8␈↓α(status␈α∩feature␈α∩␈↓↓foo␈↓α)␈↓␈α∩is␈α∩roughly␈α∩equivalent␈α∩to␈α∩␈↓α(memq␈α∪'␈↓↓foo␈↓α␈α∩(status
␈↓ α_␈↓α␈↓ β8features))␈↓,␈α⊃i.e.␈α∩it␈α⊃determines␈α∩whether␈α⊃this␈α∩LISP␈α⊃has␈α∩the␈α⊃␈↓↓foo␈↓-feature.
␈↓ α_␈↓␈↓ β8Note that ␈↓↓foo␈↓ is not evaluated.
␈↓ α_␈↓␈↓ β8␈↓α(sstatus␈α
feature␈α∞␈↓↓foo␈↓α)␈↓␈α
makes␈α∞␈↓↓foo␈↓␈α
a␈α∞feature.␈α
␈↓↓foo␈↓␈α∞is␈α
not␈α∞evaluated.␈α
For
␈↓ α_␈↓␈↓ β8example,␈α∞the␈α∞trace␈α∂package␈α∞does␈α∞␈↓α(sstatus␈α∂feature␈α∞trace)␈↓␈α∞when␈α∂it␈α∞is
␈↓ α_␈↓␈↓ β8loaded.
␈↓ α_␈↓Page 3-70␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓ β8Example:
␈↓ α_␈↓α␈↓ βh(cond ((status feature bignum)
␈↓ α_␈↓α␈↓ βh (prog2 nil (eval (read)) (read))) ;use ≡rst
␈↓ α_␈↓α␈↓ βh (t (read) (eval (read)) )) ;use second
␈↓ α_␈↓α␈↓ βh(defun factorial (n) ;bignum version
␈↓ α_␈↓α␈↓ βh (cond ((zerop n) 1)
␈↓ α_␈↓α␈↓ βh ((times n (factorial (sub1 n))))
␈↓ α_␈↓α␈↓ βh ))
␈↓ α_␈↓α␈↓ βh(defun factorial (n) ;≡xnum-only version
␈↓ α_␈↓α␈↓ βh (do () ((not (> n 13.))) ;do until n <λ← 13.
␈↓ α_␈↓α␈↓ βh (error "argument too big - factorial"
␈↓ α_␈↓α␈↓ βh n
␈↓ α_␈↓α␈↓ βh 'wrng-type-arg))
␈↓ α_␈↓α␈↓ βh (cond ((zerop n) 1)
␈↓ α_␈↓α␈↓ βh ((* n (factorial (1- n)))) ))
␈↓ α_␈↓␈↓αnofeature␈↓␈↓ β8␈↓α(sstatus␈α∃nofeature␈α∃␈↓↓foo␈↓α)␈↓␈α∃makes␈α∃␈↓↓foo␈↓␈α∃not␈α∃be␈α∃a␈α∃feature.␈α∃ ␈↓↓foo␈↓␈α∃is␈α∀not
␈↓ α_␈↓␈↓ β8evaluated.
␈↓ α_␈↓␈↓ β8␈↓α(status␈α↔nofeature␈α↔␈↓↓foo␈↓α)␈↓␈α↔is␈α↔equivalant␈α↔to␈α↔␈↓α(not␈α_(status␈α↔feature
␈↓ α_␈↓α␈↓ β8␈↓↓foo␈↓α))␈↓.
␈↓ α_␈↓␈↓αstatus␈↓␈↓ β8␈↓α(status␈α
status␈α
␈↓↓foo␈↓α)␈↓␈α
returns␈α
␈↓αt␈↓␈α
if␈α∞␈↓↓foo␈↓␈α
is␈α
a␈α
valid␈α
␈↓αstatus␈↓␈α
function.␈α∞ If␈α
it
␈↓ α_␈↓␈↓ β8is not, ␈↓αnil␈↓ is returned.
␈↓ α_␈↓␈↓ β8␈↓α(status␈α
status)␈↓␈α
returns␈α∞a␈α
list␈α
of␈α∞valid␈α
␈↓αstatus␈↓␈α
functions.␈α∞ The␈α
names
␈↓ α_␈↓␈↓ β8are␈α∂truncated␈α∂to␈α⊂some␈α∂implementation-dependent␈α∂number␈α⊂of␈α∂characters,
␈↓ α_␈↓␈↓ β8such as 4 or 5.
␈↓ α_␈↓␈↓αsstatus␈↓␈↓ β8␈↓α(status␈α
sstatus␈α
␈↓↓foo␈↓α)␈↓␈α
returns␈α
␈↓αt␈↓␈α
if␈α
␈↓↓foo␈↓␈α
is␈α
a␈α
valid␈α
␈↓αsstatus␈↓␈α∞function.␈α
If
␈↓ α_␈↓␈↓ β8it is not, ␈↓αnil␈↓ is returned.
␈↓ α_␈↓␈↓ β8␈↓α(status␈α∂sstatus)␈↓␈α∞returns␈α∂a␈α∞list␈α∂of␈α∞valid␈α∂␈↓αsstatus␈↓␈α∞functions.␈α∂ As␈α∞with
␈↓ α_␈↓␈↓ β8␈↓α(status␈α∪status)␈↓,␈α∪the␈α∪names␈α∪are␈α∪truncated␈α∪to␈α∀some␈α∪implementation-
␈↓ α_␈↓␈↓ β8dependent number of characters, such as 4 or 5.
␈↓ α_␈↓␈↓β1.8.2 Time␈↓
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.8.1␈↓␈↓
↓Page 3-71
␈↓ α_␈↓**DRAFT**␈↓ ¬→Maclisp Reference Manual␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αruntime␈↓ ∧XSUBR no args␈↓
␈↓ α_␈↓␈↓ β8␈↓α(runtime)␈↓␈αreturns␈αas␈αa␈α≡xnum␈αthe␈αnumber␈αof␈αmicroseconds␈αof␈αcpu␈αtime
␈↓ α_␈↓␈↓ β8used␈α∂so␈α∂far␈α⊂by␈α∂the␈α∂process␈α∂in␈α⊂which␈α∂LISP␈α∂is␈α∂running.␈α⊂ The␈α∂di≥erence
␈↓ α_␈↓␈↓ β8between␈α∞two␈α∞values␈α
of␈α∞␈↓α(runtime)␈↓␈α∞indicates␈α
the␈α∞amount␈α∞of␈α
computation
␈↓ α_␈↓␈↓ β8that was done between the two calls to ␈↓αruntime␈↓.
␈↓ α_␈↓␈↓αtime␈↓ ∧XSUBR no args␈↓
␈↓ α_␈↓␈↓ β8␈↓α(time)␈↓␈α∞returns␈α
the␈α∞time␈α
that␈α∞the␈α
system␈α∞has␈α
been␈α∞up,␈α
in␈α∞seconds.␈α∞(As␈α
a
␈↓ α_␈↓␈↓ β8∨onum.)␈αThe␈αdi≥erence␈αbetween␈αthe␈αresults␈αof␈αtwo␈αcalls␈αto␈α␈↓αtime␈↓␈αindicates
␈↓ α_␈↓␈↓ β8the␈α
amount␈α
of␈α
elapsed␈α
real␈α
time.␈α
(In␈α
the␈α
ITS␈α
implementation,␈α
time␈α
that
␈↓ α_␈↓␈↓ β8elapses␈α↔while␈α↔the␈α↔system␈α↔is␈α↔stopped␈α↔due␈α↔to␈α↔memory␈α↔errors␈α↔is␈α↔not
␈↓ α_␈↓␈↓ β8considered "real" and not counted.)
␈↓ α_␈↓␈↓αsleep␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β8␈↓α(sleep␈α␈↓↓n␈↓α)␈↓␈αcauses␈αa␈α
real-time␈αdelay␈αof␈α␈↓↓n␈↓␈α
seconds,␈αthen␈αreturns␈α␈↓↓n␈↓.␈α
␈↓↓n␈↓␈αmay
␈↓ α_␈↓␈↓ β8be a ≡xnum or a ∨onum.
␈↓ α_␈↓See␈α⊃also␈α⊂the␈α⊃␈↓αalarmclock␈↓␈α⊂function,␈α⊃section␈α⊂1.4.3,␈α⊃and␈α⊂the␈α⊃␈↓αdate␈↓,␈α⊂␈↓αdaytime␈↓,␈α⊃and␈α⊂␈↓αdow␈↓
␈↓ α_␈↓functions of the ␈↓αstatus␈↓ special form, described in the preceding section.
␈↓ α_␈↓␈↓β1.8.3 Escaping from Lisp␈↓
␈↓ α_␈↓␈↓ αHIt␈αis␈αpossible␈αto␈αescape␈αtemporarily␈α
from␈αLISP␈αto␈αexecute␈αa␈αcommand␈αin␈α
the␈αhost
␈↓ α_␈↓operating␈αsystem.␈α Of␈α
course,␈αthe␈αprogram␈α
(or␈αuser)␈αthat␈α
supplies␈αthe␈αcommand␈αhas␈α
to
␈↓ α_␈↓know␈α∂which␈α∂operating␈α∂system␈α∂it␈α∂is␈α∂running␈α∂under.␈α∂ It␈α∂is␈α∂also␈α∂possible␈α∂for␈α⊂LISP␈α∂to
␈↓ α_␈↓return␈α≠permanently␈α≠to␈α≠the␈α≠host␈α≠operating␈α≠system.␈α≠ This␈α≠discards␈α≠the␈α≠LISP
␈↓ α_␈↓environment and gives back whatever resources, such as memory, it was using.
␈↓ α_␈↓␈↓ ∧≥␈↓βin the Multics implementation␈↓
␈↓ α_␈↓␈↓αcline␈↓ ∧XSUBR 1 arg␈↓
␈↓ α_␈↓␈↓ β_␈↓α(cline␈α
␈↓↓x␈↓α)␈↓,␈α
where␈α
␈↓↓x␈↓␈α
is␈α
a␈α
character␈α
string,␈α
executes␈α
the␈α
Multics␈α
command␈α␈↓↓x␈↓
␈↓ α_␈↓␈↓ αhand returns ␈↓αnil␈↓. Example:
␈↓ α_␈↓␈↓ ¬0␈↓α(cline "who -long")␈↓
␈↓ α_␈↓Page 3-72␈↓ ε∃␈↓∧∪3-1.8.2␈↓␈↓ February 10, 1977
␈↓ α_␈↓**DRAFT**␈↓ ¬|The System␈↓ \**DRAFT**
␈↓ α_␈↓␈↓αquit␈↓ ∧XSUBR no args␈↓
␈↓ α_␈↓␈↓ β_␈↓α(quit)␈↓␈αreturns␈αfrom␈αthe␈αlisp␈αcommand,␈αfreeing␈αup␈αthe␈αtemporary␈αsegments
␈↓ α_␈↓␈↓ αhthat were used to hold the LISP environment.
␈↓ α_␈↓␈↓ ∧C␈↓βin the ITS implementation␈↓
␈↓ α_␈↓␈↓αvalret␈↓ ∧XLSUBR 0 or 1 args␈↓
␈↓ α_␈↓␈↓ β_␈↓α(valret)␈↓␈α∞is␈α∂like␈α∞␈↓α(ioc␈α∞z)␈↓;␈α∂that␈α∞is,␈α∞it␈α∂does␈α∞a␈α∞.LOGOUT␈α∂if␈α∞LISP␈α∞is␈α∂a␈α∞top
␈↓ α_␈↓␈↓ αhlevel procedure, and otherwise valrets ":VK " to DDT.
␈↓ α_␈↓␈↓ β_␈↓α(valret␈α∞␈↓↓x␈↓α)␈↓␈α∞e≥ectively␈α∞performs␈α∞an␈α∞␈↓αexplodec␈↓␈α∞on␈α∞␈↓↓x␈↓␈α∞(in␈α∞practice␈α∞␈↓↓x␈↓␈α∞is␈α
some
␈↓ α_␈↓␈↓ αhstrange␈α∪atomic␈α∪symbol␈α∪like␈α∪␈↓α:PROCED/␈α∪:DISOWN/␈α∀␈↓␈α∪,␈α∪but␈α∪it␈α∪may␈α∪be␈α∀any␈α∪S-
␈↓ α_␈↓␈↓ αhexpression).␈α⊗ If␈α⊗the␈α⊗string␈α⊗of␈α⊗characters␈α⊗is␈α⊗one␈α⊗of␈α⊗"␈↓α$↑X.␈↓",␈α⊗"␈↓α:KILL␈α↔␈↓",␈α⊗or
␈↓ α_␈↓␈↓ αh"␈↓α:KILL↑M␈↓"␈α∃then␈α∀␈↓αvalret␈↓␈α∃performs␈α∀a␈α∃"silent␈α∀kill"␈α∃by␈α∀executing␈α∃a␈α∀.BREAK
␈↓ α_␈↓␈↓ αh16,20000;␈αotherwise␈α␈↓αvalret␈↓␈αperforms␈αa␈α.VALUE,␈αgiving␈αthe␈αcharacter␈α
string␈αto
␈↓ α_␈↓␈↓ αhDDT to evaluate as commands.
␈↓ α_␈↓␈↓ β_Examples:
␈↓ α_␈↓␈↓ β_␈↓α(valret ':PROCED/ :DISOWN/ )␈↓
␈↓ α_␈↓␈↓ β_starts the LISP running on its own without a terminal.
␈↓ α_␈↓␈↓ β_␈↓α(valret '/ :KILL/ :TECO/↑M)␈↓
␈↓ α_␈↓␈↓ β_kills the LISP and starts up a TECO.
␈↓ α_␈↓␈↓ β_␈↓α(valret '0$N)␈↓
␈↓ α_␈↓␈↓ β_causes DDT to print out the contents of all non-zero locations in LISP.
␈↓ α_␈↓␈↓ ∧≥␈↓βin the DEC-10 implementation␈↓
␈↓ α_␈↓␈↓ β_There␈α⊂is␈α⊂currently␈α⊂no␈α⊂way␈α⊂for␈α⊂LISP␈α⊂to␈α⊂return␈α⊂a␈α⊂command␈α⊂string␈α⊂to␈α⊂the
␈↓ α_␈↓␈↓ αhMonitor␈α
in␈α
the␈α
DEC-10␈α
implementation.␈α
However,␈α
␈↓α(valret)␈↓␈α
will␈αreturn␈α
control
␈↓ α_␈↓␈↓ αhto␈α∃the␈α∃monitor␈α∀so␈α∃that␈α∃a␈α∀command␈α∃may␈α∃be␈α∀manually␈α∃typed.␈α∃ Then␈α∀type
␈↓ α_␈↓␈↓ αhCONTINUE to resume lisp.
␈↓ α_␈↓February 10, 1977␈↓ ε∃␈↓∧∪3-1.8.3␈↓␈↓ ⎇Page 3-73
ββββ